This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2014年10月31日 22:14 by ethan.furman, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg230397 - (view) | Author: Ethan Furman (ethan.furman) * (Python committer) | Date: 2014年10月31日 22:14 | |
--> 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 message: TypeError: unsupported operand type(s) for -=: 'collections.deque' and 'int' which is what happens with -=, *=, /=, |=, at which point I stopped testing. |
|||
| msg230398 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2014年10月31日 22:15 | |
Please don't replicate the same variant of the issue multiple times. |
|||
| msg230403 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2014年10月31日 22:23 | |
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) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:09 | admin | set | github: 66968 |
| 2014年10月31日 22:23:33 | rhettinger | set | status: open -> closed resolution: not a bug messages: + msg230403 |
| 2014年10月31日 22:15:52 | rhettinger | set | messages: + msg230398 |
| 2014年10月31日 22:14:36 | ethan.furman | create | |