Ticket #3938 (closed defect: fixed)
[with patch, with positive review] coercion framework converts built-in types to Sage types when it should not
| Reported by: | cwitty | Owned by: | robertwb |
|---|---|---|---|
| Priority: | major | Milestone: | sage-3.3 |
| Component: | coercion | Keywords: | |
| Cc: | cwitty | Author(s): | |
| Report Upstream: | Reviewer(s): | ||
| Merged in: | Work issues: |
Description (last modified by mabshoff) (diff)
This came up while reviewing #2898, which adds a conversion from float to ZZ (for integral values). After applying that patch, you get:
sage: 1.0r/8 1/8
That's because of this code in coerce.pyx, which does a conversion rather than a coercion:
elif PY_IS_NUMERIC(x):
try:
x = yp(x)
if PY_TYPE_CHECK(yp, type): return x,y
I tried to fix this, but every time I fixed something it broke something else. I'm going to attach my latest non-working patch, which may or may not be a useful place to start.
[Once this ticket has been reviewed and merged #2898 should be closed]
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

