On 2015-01-01 17:35, Alan Gauld wrote:

Repeats replicates the reference to the object but
does not create a new object.

This part I can understand but, as Steven has pointed out,
this behaviour changes if the object being repeated is immutable.
Why would one get a new object (rather than a new reference to it)
just because it is immutable?  It's this difference in behaviour
that depends on mutability that I still don't understand even though
Steven did try to explain it to me:
"""
If the list items are immutable, like ints or strings, the difference
doesn't matter. You can't modify immutable objects in-place, so you
never notice any difference between copying them or not.
"""


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to