What is the role of F in dict(E, **F)

Alex lidenalex at yahoo.se
Mon Sep 5 04:16:58 EDT 2005


Entering

>>> help(dict.update)
Help on method_descriptor:

update(...)
    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]

>>>

As I understand update() is used to merge two dictionaries, for example

>>> D={'a':1, 'b':2}
>>> E={'b':4,'c':6}
>>> D.update(E)
>>> D
{'a': 1, 'c': 6, 'b': 4}
>>>

But what is the role of **F?

Alex




More information about the Python-list mailing list