Reference semantics
Assignment manipulates references
x = y does not make a copy of y
x = y makes x reference the object y references
Very useful; but beware!
Example:
>>> a = [1, 2, 3]; b = a
>>> a.append(4); print b
[1, 2, 3, 4]
Previous slide
Next slide
Back to first slide
View graphic version