Re: [Python-ideas] Binary arithmetic does not always call subclasses first

2017-04-23 Thread Greg Ewing
Stephan Hoyer wrote: In practice, CPython requires that the right operand defines a different method before it defers to it. I'm not sure exactly what the rationale for this behaviour is, but it's probably something along the lines that the left method should already know how to deal with that

Re: [Python-ideas] Binary arithmetic does not always call subclasses first

2017-04-23 Thread Steven D'Aprano
On Sun, Apr 23, 2017 at 06:23:12PM -0700, Stephan Hoyer wrote: > I recently filed this as a bug, and was asked to repost to python-dev or > python-ideas for greater visibility: > http://bugs.python.org/issue30140 > > Without further ado, here is my original report: [...] > The reference documenta

[Python-ideas] Binary arithmetic does not always call subclasses first

2017-04-23 Thread Stephan Hoyer
I recently filed this as a bug, and was asked to repost to python-dev or python-ideas for greater visibility: http://bugs.python.org/issue30140 Without further ado, here is my original report: --- We are writing a system for overloading NumPy operations (see PR [1] and des