Collections of non-arbitrary objects ?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Jun 25 21:36:34 EDT 2007


En Mon, 25 Jun 2007 11:14:23 -0300, walterbyrd <walterbyrd at iname.com>  
escribió:

> I have probably expressed this incorrectly. What I meant was:
>
>>>> a = [1,2,3]
>>>> b = a
>>>> a[1] = 'spam'
>
> Here, I have changed b, without an explicit assignment. After I
> assigned a to b, I never did another "b =" yet b changed anyway
> because I changed a. I am not saying there is anything wrong with
> this, I'm just explaining what I meant.

I think you should benefit reading this short article:
http://effbot.org/zone/python-objects.htm

-- 
Gabriel Genellina




More information about the Python-list mailing list