This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients gumtree, mark.dickinson, meador.inge
Date 2010-11-28.20:46:15
SpamBayes Score 9.946491e-05
Marked as misclassified No
Message-id <1290977181.61.0.0979561407185.issue5211@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2010-11-28 20:46:21mark.dickinsonsetrecipients: + mark.dickinson, gumtree, meador.inge
2010-11-28 20:46:21mark.dickinsonsetmessageid: <1290977181.61.0.0979561407185.issue5211@psf.upfronthosting.co.za>
2010-11-28 20:46:15mark.dickinsonlinkissue5211 messages
2010-11-28 20:46:15mark.dickinsoncreate