Unexpected result for list operator "+="

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


In article <mfW46.227356$U46.7026522 at news1.sttls1.wa.home.com>, "Greg
Jorgensen" <gregj at pobox.com> writes: A

| You discovered the documented behavior. Assignment of immutable objects
| (numbers, strings, tuples) essentially makes a copy of the object.
| Assignment of mutable objects (lists, dictionaries) creates a new reference
| to the original object.

actually assignment is always just about references, even
with immutable objects.

  -- erno



More information about the Python-list mailing list