Append a new value to dict
Bruno Desthuilliers
bruno.42.desthuilliers at websiteburo.invalid
Mon Oct 13 10:10:26 EDT 2008
bearophileHUGS at lycos.com a écrit :
> jdd:
>> foo = {'bar': 'baz'}
>> foo.update({'quux': 'blah'})
>
> That creates a new dict, to throw it away.
Just to make it clear for the easily confused ones (like me...):
bearophile is talking about the dict passed as an argument to foo.update
- not about the behaviour of dict.update itself (which of course
modifies the dict in place) !-)
More information about the Python-list
mailing list