inverse of the zip function

Raymond Hettinger vze4rx4y at verizon.net
Tue Jul 29 21:51:32 EDT 2003


> I understand why it works as inverse when *<list> creates a argument list of
> list element. But don't understand why * works that way in this context.
> Does ** do this for maps and keywordargs, too? Hey, this is python - lets
> try:
> >>> def foo(a=None, b=None):
> ...   pass
> ...
> >>> foo(a=10, b=20)
> >>> foo(**{'a':10, 'b':20})
> >>>
>
> Coooool. Where is that documented? Never stumbled across it so far!

http://www.python.org/dev/doc/devel/ref/calls.html


Raymond Hettinger






More information about the Python-list mailing list