Le dimanche 22 février 2015 15:24:53 UTC+1, Simon King a écrit : > > > Seriously? I didn't know that Sage's coercion model has such special > cases. OK, it makes it possible to get a typical usecase with least > effort. > But my impression is that ultimately such special cases cause a lot more > confusion than a clear model in the spirit of "arithmetics across > parents relies on coercion morphisms, which are canonical morphisms in > suitable categories, and the composition of coercion morphisms is a > coercion morphism". > > I agree. Actually, I've discovered the quoted lines of sage.structure.coerce.pyx while trying to understand why 0+x works while QQ(0) + x does not.
Note this: > sage: from sage.rings.integer import is_Integer > sage: is_Integer(int(0)) > False > Note that the function is_Integer used in sage.structure.coerce.pyx is *not* the above one: it is defined in lines 134-139 and it returns True for is_Integer(int(0)). Best regards, Eric. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.