> foo = {'a':1, 'b':2, 'c':foo['a']}
TRy
foo = {'a':1, 'b':2}
foo['c'] = foo['a']
The only reasobn it ddidn't work before was that
foo didn't exist at the time you tried to add the reference.
foo['c'] is just a reference to whatever foo['a'] references.
foo['d'] = foo
is a tad more interestin
On Apr 2, 2005, at 12:12, Liam Clarke wrote:
Hi,
Out of curiosity, is it possible to create a dictionary like this -
foo = {'a':1, 'b':2, 'c':foo['a']}
I know that as above doesn't work, but was just wondering if it's
possible, and if it's a
Bad Thing?
Regards,
Liam Clarke
It doesn't work because
Hi,
Out of curiosity, is it possible to create a dictionary like this -
foo = {'a':1, 'b':2, 'c':foo['a']}
I know that as above doesn't work, but was just wondering if it's
possible, and if it's a
Bad Thing?
Regards,
Liam Clarke
--
'There is only one basic human right, and that is to do as