[issue22778] list's in-place add doesn't return NotImplemented when appropriate

Ethan Furman report at bugs.python.org
Fri Oct 31 23:43:34 CET 2014


Ethan Furman added the comment:

My understanding was that if a different patch will be needed, it is not the same issue.  Is that not correct?

Here's the test:

    def test_iadd(self):
        ...
        self.assertRaises(TypeError, u.__iadd__, None)

It would still pass, as returning NotImplemented will still result in a TypeError, just with a friendlier message.

If any code is depending on this, it is depending on the error message text, which is explicitly not guaranteed

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22778>
_______________________________________


More information about the Python-bugs-list mailing list