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

2017-04-27 Thread Nick Coghlan
On 26 April 2017 at 02:56, Guido van Rossum wrote: > In the end I agree with the OP that we should fix this. I don't see a reason > to require a PEP or require updating whatever PEP described this behavior > originally -- PEPs generally describe what should be done to a

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

2017-04-25 Thread Guido van Rossum
Now that I am with a real keyboard and screen and have tried to understand the OP, I can actually write up my thoughts on the matter. There are two aspects to the behavior. Giving preference to the class of the right operand if it is a subclass of the left operand's class is reasonable and

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

2017-04-24 Thread Guido van Rossum
If this is portant I should probably ponder it. On Apr 24, 2017 4:47 PM, "Stephan Hoyer" wrote: > +Georg Brandl, in case he remembers where "Move the 3k reST doc tree in > place." moved things from: > https://github.com/python/cpython/commit/116aa62bf54a39697e25f21d6cf679 >

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

2017-04-24 Thread Stephan Hoyer
+Georg Brandl, in case he remembers where "Move the 3k reST doc tree in place." moved things from: https://github.com/python/cpython/commit/116aa62bf54a39697e25f21d6cf6799f7faa1349 On Mon, Apr 24, 2017 at 4:29 PM, Nick Timkovich wrote: > GitHub shows that that note

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

2017-04-24 Thread Nick Timkovich
GitHub shows that that note hasn't changed in 10 years: https://github.com/python/cpython/blame/master/Doc/reference/datamodel.rst#L2210 On Mon, Apr 24, 2017 at 3:15 PM, Terry Reedy wrote: > On 4/24/2017 12:14 PM, Stephan Hoyer wrote: > > Based on the change in the

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

2017-04-24 Thread Terry Reedy
On 4/24/2017 12:14 PM, Stephan Hoyer wrote: Based on the change in the documentation between 2.x and 3.x, I wonder if this is something that someone intended to clean up as part of Python 3000 but never got around to. I would love to hear from anyone familiar with the historical context here.

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

2017-04-24 Thread Steven D'Aprano
On Mon, Apr 24, 2017 at 05:57:17PM +1200, Greg Ewing wrote: > 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

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

2017-04-24 Thread Stephan Hoyer
On Sun, Apr 23, 2017 at 10:57 PM, Greg Ewing wrote: > 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

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

[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