Unexpected result for list operator "+="

Erno Kuusela erno-news at erno.iki.fi
Thu Jan 4 04:05:52 EST 2001


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

| 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 (non-augmented) assignment is always just about references, even
with immutable objects.

  -- erno



More information about the Python-list mailing list