[issue4109] Wrong UnboundLocalError with += operator

Benjamin Peterson report at bugs.python.org
Sun Oct 12 16:08:37 CEST 2008


Benjamin Peterson <musiccomposition at gmail.com> added the comment:

Inplace operators ("+=", "-=" etc) are assignments since in the case of
immutable types like str

code += "some string"

is equivalent to

code = code + "some string"

----------
resolution:  -> invalid
status: open -> closed

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


More information about the Python-bugs-list mailing list