Changes between Version 3 and Version 4 of Ticket #715, comment 198


Ignore:
Timestamp:
08/16/12 21:39:35 (9 years ago)
Author:
nbruin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #715, comment 198

    v3 v4  
    5555chance of having a coerce map to self?
    5656
     57YEP it is. In vanilla 5.0 (so that's even WITH caching)
     58
     59{{{
     60sage: R=Rings()
     61sage: timeit('ZZ.has_coerce_map_from(3)')
     62625 loops, best of 3: 15.9 µs per loop
     63sage: timeit('3 in R')
     64625 loops, best of 3: 6.55 µs per loop
     65}}}
     66
     67so we should definitely test the category of the element. Question is: which
     68category? Ideals are not in `Rings()` (which are unitary rings), but they are in
     69CommutativeAdditiveMonoids(). Creation of ideals still works if this works,
     70though:
     71{{{
     72sage: ZZ.has_coerce_map_from(3*ZZ)
     73False
     74}}}
     75so I'm not so sure if that branch ever essentially gets used.
     76
    5777-------------------------------------------------------------------
    5878The storing happens in sage.structure.parent (line 1990):