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.

Author rhettinger
Recipients Joshua.Chin, ethan.furman, pitrou, r.david.murray, rhettinger
Date 2014-10-31.21:12:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1414789968.36.0.504210271299.issue22766@psf.upfronthosting.co.za>
In-reply-to
Content
Here is what other mutable types do:

>>> s = []
>>> s.__iadd__(1)
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    s.__iadd__(1)
TypeError: 'int' object is not iterable

>>> s = set()
>>> s.__ior__(1)
NotImplemented

>>> from collections import deque
>>> s = deque()
>>> s.__iadd__(1)
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    s.__iadd__(1)
TypeError: 'int' object is not iterable

>>> from array import array
>>> s = array('i')
>>> s.__iadd__(1)
Traceback (most recent call last):
  File "<pyshell#10>", line 1, in <module>
    s.__iadd__(1)
TypeError: can only extend array with array (not "int")

>>> s = bytearray()
>>> s.__iadd__(1)
Traceback (most recent call last):
  File "<pyshell#12>", line 1, in <module>
    s.__iadd__(1)
TypeError: can't concat int to bytearray
History
Date User Action Args
2014-10-31 21:12:48rhettingersetrecipients: + rhettinger, pitrou, r.david.murray, ethan.furman, Joshua.Chin
2014-10-31 21:12:48rhettingersetmessageid: <1414789968.36.0.504210271299.issue22766@psf.upfronthosting.co.za>
2014-10-31 21:12:48rhettingerlinkissue22766 messages
2014-10-31 21:12:48rhettingercreate