[issue16701] Docs missing the behavior of += (in-place add) for lists.

R. David Murray report at bugs.python.org
Sun Dec 16 22:44:54 CET 2012


R. David Murray added the comment:

Well, it is effectively documented by the text here:

   http://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements

since "a + b" is logically equivalent to a.extend(b) when a is being updated "in-place".  The fact that it is in fact implemented using extend is an implementation detail.

That said, it would be logical to add an entry for the augmented assignment to the table here:

   http://docs.python.org/3/library/stdtypes.html#mutable-sequence-types

There also may be other places in that chapter where augmented assignment deserves mention.

----------
nosy: +r.david.murray
versions:  -Python 3.1, Python 3.5

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


More information about the Python-bugs-list mailing list