Opened 7 years ago
Closed 7 years ago
#19575 closed defect (fixed)
Conversion PARI t_STR -> Python str should not keep quotes
Reported by: | Jeroen Demeyer | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.10 |
Component: | interfaces: optional | Keywords: | |
Cc: | Peter Bruin | Merged in: | |
Authors: | Jeroen Demeyer | Reviewers: | Peter Bruin |
Report Upstream: | N/A | Work issues: | |
Branch: | 1668133 (Commits, GitHub, GitLab) | Commit: | 1668133626492e0b9e94b03fe98d67279e1cca3c |
Dependencies: | Stopgaps: |
Description
This should be without quotes, similar to the difference between repr()
and str()
of a Python string:
sage: print pari('"hello world"') "hello world"
Change History (7)
comment:1 Changed 7 years ago by
Branch: | → u/jdemeyer/str_pari_gen |
---|
comment:2 Changed 7 years ago by
Commit: | → 29128c2ada7a6465d470336dbcc0e8061ea497f4 |
---|---|
Status: | new → needs_review |
comment:3 Changed 7 years ago by
Reviewers: | → Peter Bruin |
---|---|
Status: | needs_review → needs_work |
- The patchbot reports a doctest failure in
sage.interfaces.interface.InterfaceElement.__reduce__
. I think the quoted version"abc"
is the correct output. Probablygen.__reduce__()
should use__repr__()
instead of__str__()
. - It would look better to use
%r
in the error message that you change in the patch, and actually I would also prefer putting a space after the=
, i.e.raise TypeError("x (= %r) must be of type t_INT, but is of type %s" % (x, x.type()))
(For the second point, maybe we can even remove the type check and rely on PARI to raise an error.)
comment:4 Changed 7 years ago by
Commit: | 29128c2ada7a6465d470336dbcc0e8061ea497f4 → 1668133626492e0b9e94b03fe98d67279e1cca3c |
---|
comment:5 Changed 7 years ago by
Status: | needs_work → needs_review |
---|
comment:7 Changed 7 years ago by
Branch: | u/jdemeyer/str_pari_gen → 1668133626492e0b9e94b03fe98d67279e1cca3c |
---|---|
Resolution: | → fixed |
Status: | positive_review → closed |
Note: See
TracTickets for help on using
tickets.
New commits:
Implement conversion PARI t_STR -> Python string