Message3404
Looks like the "subtype checking to start rich-cmp with the second arg"
[*] behavior can be justified as being consistent with what
http://docs.python.org/ref/coercion-rules.html says about binary operators:
"Exception to the previous item: if the left operand is an instance of a
built-in type or a new-style class, and the right operand is an instance
of a proper subclass of that type or class and overrides the base's
__rop__() method, the right operand's __rop__() method is tried before
the left operand's __op__() method. "
"Interestingly", CPython only does this for rich-cmp, but not for old
__cmp__.
[*] To avoid refering the examples by meaningless ordinals, I'm going to
call the three previous examples from now on as:
- first example == "__cmp__ first on the same type"
- second example == "subtype checking to start rich-cmp with the second arg"
- third example == "start with old-style instances __cmp__" |
|
Date |
User |
Action |
Args |
2008-08-05 20:00:56 | leosoto | set | messageid: <1217966456.76.0.412850403312.issue1031@psf.upfronthosting.co.za> |
2008-08-05 20:00:56 | leosoto | set | recipients:
+ leosoto, fwierzbicki, pjenvey |
2008-08-05 20:00:56 | leosoto | link | issue1031 messages |
2008-08-05 20:00:54 | leosoto | create | |
|