Unexpected result for list operator "+="

Erno Kuusela erno-news at erno.iki.fi
Thu Jan 4 19:08:33 EST 2001


In article <mailman.978626891.31087.python-list at python.org>, Thomas
Wouters <thomas at xs4all.net> writes:

| actually *augmented* assignment is, too. *everything* is about references :)

fair enough :)

what i was trying to refer (no pun intended) to, augmented assignment
can make new copies. as in:

s = s2 = 'foo'
s += 'bar'
s2 is not s

  -- erno



More information about the Python-list mailing list