Message2308

Author pedronis
Recipients
Date 2004-01-26.21:20:16
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=61408

...
that code means that if it's there, cmp will try __cmp__ before
rich comparisons,  at the moment we don't have support
to naturally check something like v->ob_type->tp_compare !=
NULL, I expect we will grow it with new-style classes code.
We could also punt on this.

Notice that eagerly coercing cmp(C(),C()) does not try D's
rich __eq__.

the patch like the previous code does not eagerly coerce,
this is the output with a patched jython:

log: [] coerce((),C()): (<__main__.C instance 1>,
<__main__.C instance 2>)
log: [] cmp(C(),C()): -1
log: ['D_eq'] cmp(C(),D()): 0
log: ['D_eq'] cmp(D(),C()): 0
log: ['D_eq'] cmp(D(),D()): 0
log: [] C()==C(): 0
log: ['D_eq'] C()==D(): 1
log: ['D_eq'] D()==C(): 1
log: ['D_eq'] D()==D(): 1

....



History
Date User Action Args
2008-02-20 17:18:22adminlinkissue859555 messages
2008-02-20 17:18:22admincreate