what does 'a=b=c=[]' do

Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915 at spamschutz.glglgl.de
Sat Dec 24 13:45:39 EST 2011


Am 22.12.2011 00:20 schrieb Dennis Lee Bieber:

> 	The key one is that lists ([] defines a list, not an array) are
> "mutable". Your "7" is not mutable.

Strictly spoken, that's only a "side show" where the effect is visible.

The real key concept is that [] creates *one* object which is then 
assigned to the three names. That's the same for mutable and immutable 
objects.

But only the modification which happens on mutable objects turns it into 
a problem.

The rest o your explanation is 100% correct.


Thomas



More information about the Python-list mailing list