On Apr 14, 2005, at 12:58, Orri Ganel wrote:

a = Node(1)
b = Node(a)
12932600 12932600
1
id(b)
12960632

Any ideas on why this happens, or suggestions as to how to implement
the behavior I'm looking for (in which b and a would refer to the same
object, have the same id, etc.), would be greatly appreciated.

Well, if you want b and a to refer to the same object, just use b = a. Everything is a reference in Python, make use of this feature. (at that point, I expect Alan to drop in and explain why what I said is not entirely accurate, but good enough ;) )


-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting and sweating as you run through my corridors... How can you challenge a perfect, immortal machine?"



_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Reply via email to