[issue9401] automatically try forward operations when reverse operations are NotImplemented

2010-09-23 Thread R. David Murray
R. David Murray added the comment: No, but you could bring it up on python-ideas. (It would have to wait until after the moratorium in any case.) -- nosy: +r.david.murray ___ Python tracker __

[issue9401] automatically try forward operations when reverse operations are NotImplemented

2010-09-20 Thread Michael Gilbert
Michael Gilbert added the comment: i think that, for example, the default __rsub__ implementation could be: return self + -other which should just do the right thing assuming the addition and negation functions already do the right thing for the class type. anyway, any implementation shoul

[issue9401] automatically try forward operations when reverse operations are NotImplemented

2010-07-29 Thread Georg Brandl
Georg Brandl added the comment: This might work for (normally) commutative operations like multiplication and addition, but what about those like subtraction? If the interpreter uses the non-reversed method automatically, it has to apply semantics, but the semantics depend on the type and ca

[issue9401] automatically try forward operations when reverse operations are NotImplemented

2010-07-28 Thread Michael Gilbert
New submission from Michael Gilbert : in order to make overrides simpler, and more obvious to average developers, it would be very useful to automatically call the forward operations (e.g. __mul__) when the reverse operations (e.g. __rmul__) are NotImplemented. i spent quite a bit of time tr