[Python-3000] pep 3124 plans

Nick Coghlan ncoghlan at gmail.com
Tue Jul 24 14:25:57 CEST 2007


Phillip J. Eby wrote:
> At 12:54 PM 7/24/2007 +1200, Greg Ewing wrote:
>>  > binary operators depend on multiple argument values (and you
>>> have to know *both* types in order to work out the result)
>> Yes, that can be a bit more complex, but at least the method
>> that gets called has to belong to one class or the other.
>> Also it's easier to follow nowadays with the auto-coercion
>> system being phased out -- the left operand gets first say,
>> and if it doesn't care, the right operand gets its say.
> 
> Oh really?  Are you sure about that?  I was under the impression that 
> under certain circumstances, if one object is "more specific" than 
> the other (i.e., one is an instance of a subclass of the other's 
> type), then that one gets first say.

Yep, and that feature stays even with __coerce__ going away. Otherwise 
subclasses would have a hell of a time getting their __r*__ methods to 
be invoked instead of the base classes.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list