inverse of the zip function

Raymond Hettinger vze4rx4y at verizon.net
Wed Jul 30 03:51:32 CEST 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