30 Mar
2007
30 Mar
'07
3:50 p.m.
* Tim Allen <screwtape@froup.com> [2007-03-30 20:04:18 +1000]:
Ah, but continuing:
p.i = 5 p.i 5 q.i 2
i is still not a class attribute in the same way it might be for Java or C++.
It would probably be more correct to say that "value types" and "assignment" work differently in Python compared with Java/C++. More specifically, in Java/C++, "value types" like int or Integer are mutable, and the "=" operator mutates them. In python, they are immutable, and the "=" operator never mutates objects, but instead inds a variable / attribute / etc. to a new object reference. -- mithrandi, i Ainil en-Balandor, a faer Ambar