Raymond Hettinger added the comment:

Note, the += operation is conceptually similar to update() methods with are 
usually duck typeable:

>>> d = {}
>>> d.update(1)
Traceback (most recent call last):
  File "<pyshell#16>", line 1, in <module>
    d.update(1)
TypeError: 'int' object is not iterable

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

>>> dict(1)
Traceback (most recent call last):
  File "<pyshell#19>", line 1, in <module>
    dict(1)
TypeError: 'int' object is not iterable

----------

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

Reply via email to