Mark Dickinson <dicki...@gmail.com> added the comment:

> Just to keep this discussion as clear as possible Mark, it was your
> first option that I suggest is needed.

Okay, so you want <float instance> + <xint instance> to try xint.__radd__ 
before float.__add__.

How do you propose this be achieved?  Can you explain exactly what semantics 
you'd like to see?  You've indicated what you want to happen for float and 
xint, but how should Python behave in general here?

In particular, when evaluating 'x + y' for general Python objects x and y, what 
rule or rules should Python use to decide whether to try x.__add__(y) or 
y.__radd__(x) first?

It seems you want some general mechanism that results in xint being 'preferred' 
to float, in the sense that xint.__radd__ and xint.__add__ will be tried in 
preference to float.__add__ and float.__radd__ (respectively).  But it's not 
clear to me what criterion Python would use to determine which out of two types 
(neither one inheriting from the other) should be 'preferred' in this sense.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5211>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to