scope, modyfing outside object from inside the method

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Sep 27 00:41:17 EDT 2007


En Wed, 26 Sep 2007 10:39:22 -0300, Marcin Stępnicki  
<mstepnicki at gmail.com> escribi�:

> At first glance (before adding id()) it's a little bit weird. The  
> original
> object was supposedly "overwritten", but as one can see it has different
> id then the new one. mystruct still holds references to old object,
> though. I can handle it and just change original object, but I'm curious
> if there's a way to "swap" them "on-the-fly".

You should read this <http://effbot.org/zone/python-objects.htm>

-- 
Gabriel Genellina




More information about the Python-list mailing list