On Mar 13, 2009, at 7:52 PM, William Stein wrote:

> On Fri, Mar 13, 2009 at 7:06 PM, Ralf Hemmecke <r...@hemmecke.de>  
> wrote:
>>
>>>> Of course, then QQ(1)==ZZ(1) would return false. But I really don't
>>>> see a problem with that.
>>
>>> I would find that super inconvenient.
>>
>> Well, maybe later you'll appreciate my suggestion a bit more.
>>
>>> How about "parent(a) == parent(b) and a == b"
>>
>> (of course "a==b" also must have "parent(a)==parent(b)" inside,  
>> because
>> that is the condition that decides whether a coercion lookup should
>> start or whether the == just works inside the parent. So
>> "parent(a)==parent(b)" has to be evaluated twice.

Yes. Actually it tests parent(a) is parent(b) which is both really  
fast and usually true (we try to make Parents unique), so it's not  
much of an overhead.

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to