Sergey added the comment:

Steven D'Aprano noticed that there's an obscure case of:

>>> class A(list):
...     def __add__(self, other):
...         return A(super(A,self).__add__(other))
...     def __radd__(self, other):
...         return A(other) + self
...

Where:
>>> type( [1] + A([2]) )
<class '__main__.A'>

Is different from:

>>> type( [1].__add__(A([2])) )
<class 'list'>

To keep such an undefined behavior unchanged I updated the 
fastsum-special-tuplesandlists.patch to have a more strict type check.

In case somebody would like to test it, the patch is attached. It should work 
for both Python 2.7 and Python 3.3, and should introduce no behavior change.

----------
Added file: 
http://bugs.python.org/file30897/fastsum-special-tuplesandlists.patch

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

Reply via email to