List sequential initialization

HMS Surprise john at datavoiceint.com
Tue Jun 12 19:50:19 CEST 2007


I thought if I could do this:
>>> a = b = ''
>>> a = 'a'
>>> a
'a'
>>> b
''

then this would behave similarly:
>>> la = lb = []
>>> la.append('a')
>>> la
['a']
>>> lb
['a']


I thought wrong! But don't know why.

Inquiring minds want to know.....


thanx,

jh




More information about the Python-list mailing list