Message3404

Author leosoto
Recipients fwierzbicki, leosoto, pjenvey
Date 2008-08-05.20:00:54
SpamBayes Score 0.00028203317
Marked as misclassified No
Message-id <1217966456.76.0.412850403312.issue1031@psf.upfronthosting.co.za>
In-reply-to
Content
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__"
History
Date User Action Args
2008-08-05 20:00:56leosotosetmessageid: <1217966456.76.0.412850403312.issue1031@psf.upfronthosting.co.za>
2008-08-05 20:00:56leosotosetrecipients: + leosoto, fwierzbicki, pjenvey
2008-08-05 20:00:56leosotolinkissue1031 messages
2008-08-05 20:00:54leosotocreate