[issue22779] deque in-place addition does not return NotImplemented when appropriate

2014-10-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please don't replicate the same variant of the issue multiple times. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22779 ___

[issue22779] deque in-place addition does not return NotImplemented when appropriate

2014-10-31 Thread Ethan Furman
New submission from Ethan Furman: -- from collections import deque -- d = deque() -- d += 1 Traceback (most recent call last): File stdin, line 1, in module TypeError: 'int' object is not iterable deque should be returning NotImplemented, which would generate a more appropriate error

[issue22779] deque in-place addition does not return NotImplemented when appropriate

2014-10-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: This behavior was intended. It was modeled after the behavior for lists. Any change here would break code such as: d = deque() d += 'abc' # This is specially allowed (note, we have a test for it) -- resolution: - not a bug status: open