Nick Coghlan <ncogh...@gmail.com> added the comment:

Armin: yeah, I learned better in the course of trying to fix this misbehaviour 
in CPython. I've adjusted assorted sq_concat methods to return NotImplemented 
in the sandbox where I'm working on this, along with modifying abstract.c to 
correctly cope with that.

Terry: the slot signatures vary, so copying function pointers around isn't 
really viable. I'm just fixing abstract.c to call the slots in the right order.

The fun part is that historically, CPython didn't check for NotImplemented 
returns from sq_concat and sq_repeat, so those methods are all written to raise 
TypeError explicitly, which breaks delegation to __radd__ methods (i.e. exactly 
the same thing Armin fixed in PyPy).

As far as 2.7 and 3.2 go, I'm thinking a Py3k warning in the next 2.7 release 
and a CompatibilityWarning (once we have it) in the next 3.2 will be a 
possibility. However, I want to finish the patch and see the magnitude of the 
change before deciding what we do with the maintenance versions.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11477>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to