Immutability:
x=23
y=x
x=2
But y
is still 23
Memory is managed dynamically,
x= 'hello'
x= 'world'
(Values live until reference dies) 'hello' is cleaned up since it no longer has a reference.
Mutable aliasing Assignment never copies data, it simply creates ref
a = [1,2]
b = a
Only one list exists
a.append(200)
print b // [1,2,200]
a=257
b=257
a is b //False
Only if the var was less than 257 then they are True as the compiler stores their address in the same location for efficiency
Names in python have no type [They live on the heap] Values in python have no scope [They libe on the stack]