newbie question

jeff jeffrey.aylesworth at gmail.com
Sun Feb 25 19:57:25 EST 2007


On Feb 25, 7:49 pm, "S.Mohideen" <m... at blackhole.labs.rootshell.ws>
wrote:
>...
>
> what does asd.update() signifies. What is the use of it. Any comments would
> help to understand it.
>
> Thanks
> Mohideen

>>> print {}.update.__doc__
D.update(E, **F) -> None.  Update D from E and F: for k in E: D[k] =
E[k]
(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k]
= F[k]
so basically, this is what it does:

>>> e = {}
>>> f = {}
>>> f['a'] = 123
>>> e.update(f)
>>> e
{'a': 123}




More information about the Python-list mailing list