Thanks,

so I could/should do

self.ot = Bar(self.name.copy()) instead


On Jan 21, 2008 9:25 PM, Kent Johnson <[EMAIL PROTECTED]> wrote:

> John Morris wrote:
>
> > Why does the pop in the Bar class nuke the srv k & v from Foo.name
> > <http://Foo.name> as well?
>
> Because they are both names for the same dict.
>
> Assignment in Python does not copy values; it binds a name to a value.
> Some good references:
> http://effbot.org/zone/python-objects.htm
>
> http://groups.google.com/group/comp.lang.python/browse_thread/thread/56e7d62bf66a435c/
>
> Kent
>



-- 
John Morris
[EMAIL PROTECTED]
"Do nothing which is of no use." -- Miyamoto Musashi
<a href="http://profile.mygamercard.net/nerdality";>
<img src="http://card.mygamercard.net/gbar/abyss/nerdality.gif"; border=0>
</a>
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to