Created
June 29, 2014 11:08
-
-
Save pradeepvairamani/453d2488d3a93da05432 to your computer and use it in GitHub Desktop.
Tumblr:Mutability 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = something # immutable type | |
print x | |
func(x) | |
print x # prints the same thing | |
x = something # mutable type | |
print x | |
func(x) | |
print x # might print something different | |
x = something # immutable type | |
y = x | |
print x | |
# some statement that operates on y | |
print x # prints the same thing | |
x = something # mutable type | |
y = x | |
print x | |
# some statement that operates on y | |
print x # might print something different |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment