Re: [Python-Dev] Python-versus-CPython question for __mul__ dispatch

2015-05-19 Thread Armin Rigo
Hi Nick, On 16 May 2015 at 10:31, Nick Coghlan ncogh...@gmail.com wrote: Oh, that's rather annoying that the PyPy team implemented bug-for-bug compatibility there, and didn't follow up on the operand precedence bug report to say that they had done so. It's sadly not the only place, by far,

Re: [Python-Dev] Python-versus-CPython question for __mul__ dispatch

2015-05-19 Thread Kevin Modzelewski
We have a similar experience -- Pyston runs into a similar issue with sqlalchemy (with str() + foo calling foo.__radd__ before str.sq_concat) and we are working to match CPython's behavior. On Tue, May 19, 2015 at 7:00 AM, Armin Rigo ar...@tunes.org wrote: Hi Nick, On 16 May 2015 at 10:31,

Re: [Python-Dev] Python-versus-CPython question for __mul__ dispatch

2015-05-17 Thread Nathaniel Smith
On Sat, May 16, 2015 at 1:31 AM, Nick Coghlan ncogh...@gmail.com wrote: On 16 May 2015 at 07:35, Nathaniel Smith n...@pobox.com wrote: On Thu, May 14, 2015 at 11:53 PM, Nathaniel Smith n...@pobox.com wrote: On Thu, May 14, 2015 at 9:29 PM, Guido van Rossum gu...@python.org wrote: I expect you

Re: [Python-Dev] Python-versus-CPython question for __mul__ dispatch

2015-05-16 Thread Nick Coghlan
On 16 May 2015 at 07:35, Nathaniel Smith n...@pobox.com wrote: On Thu, May 14, 2015 at 11:53 PM, Nathaniel Smith n...@pobox.com wrote: On Thu, May 14, 2015 at 9:29 PM, Guido van Rossum gu...@python.org wrote: I expect you can make something that behaves like list by defining __mul__ and

Re: [Python-Dev] Python-versus-CPython question for __mul__ dispatch

2015-05-16 Thread Nick Coghlan
On 15 May 2015 at 10:45, Nathaniel Smith n...@pobox.com wrote: Hi all, While attempting to clean up some of the more squamous aspects of numpy's operator dispatch code [1][2], I've encountered a situation where the semantics we want and are using are possible according to

Re: [Python-Dev] Python-versus-CPython question for __mul__ dispatch

2015-05-16 Thread Nick Coghlan
On 15 May 2015 at 16:53, Nathaniel Smith n...@pobox.com wrote: On Thu, May 14, 2015 at 9:29 PM, Guido van Rossum gu...@python.org wrote: I expect you can make something that behaves like list by defining __mul__ and __rmul__ and returning NotImplemented. Hmm, it's fairly tricky, and part of

Re: [Python-Dev] Python-versus-CPython question for __mul__ dispatch

2015-05-15 Thread Nathaniel Smith
there could be kind of a pitfalls-page somewhere in the docs collecting these things. Best Stefan Gesendet: Freitag, 15. Mai 2015 um 02:45 Uhr Von: Nathaniel Smith n...@pobox.com An: Python Dev python-dev@python.org Betreff: [Python-Dev] Python-versus-CPython question for __mul__

Re: [Python-Dev] Python-versus-CPython question for __mul__ dispatch

2015-05-15 Thread Nathaniel Smith
On Thu, May 14, 2015 at 11:53 PM, Nathaniel Smith n...@pobox.com wrote: On Thu, May 14, 2015 at 9:29 PM, Guido van Rossum gu...@python.org wrote: I expect you can make something that behaves like list by defining __mul__ and __rmul__ and returning NotImplemented. Hmm, it's fairly tricky, and

[Python-Dev] Python-versus-CPython question for __mul__ dispatch

2015-05-14 Thread Nathaniel Smith
Hi all, While attempting to clean up some of the more squamous aspects of numpy's operator dispatch code [1][2], I've encountered a situation where the semantics we want and are using are possible according to CPython-the-interpreter, but AFAICT ought not to be possible according to

Re: [Python-Dev] Python-versus-CPython question for __mul__ dispatch

2015-05-14 Thread Guido van Rossum
:45 Uhr Von: Nathaniel Smith n...@pobox.com javascript:; An: Python Dev python-dev@python.org javascript:; Betreff: [Python-Dev] Python-versus-CPython question for __mul__ dispatch Hi all, While attempting to clean up some of the more squamous aspects of numpy's operator dispatch code

Re: [Python-Dev] Python-versus-CPython question for __mul__ dispatch

2015-05-14 Thread Stefan Richthofer
in the docs collecting these things. Best Stefan Gesendet: Freitag, 15. Mai 2015 um 02:45 Uhr Von: Nathaniel Smith n...@pobox.com An: Python Dev python-dev@python.org Betreff: [Python-Dev] Python-versus-CPython question for __mul__ dispatch Hi all, While attempting to clean up some