*args and **kwargs

John Roth johnroth at ameritech.net
Wed Nov 27 20:21:41 EST 2002


"Wojtek Walczak" <gminick at hacker.pl> wrote in message
news:slrnaual6k.20i.gminick at hannibal.localdomain...
> Dnia Wed, 27 Nov 2002 14:27:43 -0500, John Roth napisa³(a):
> > The fact that the function definition contains either * or ** has
> > nothing to do with how you call it.
> By saying this I thought about that, when you're using ** notation
> you need to call your function like this:
>
> function(a="b",b="c",c="d")

True. the ** parameter picks up unspecified keywords.

> In second of my examples, you can call a function by passing
> a dictionary to it as is:
>
> second({"a":"b", "b":"c", "c":"d"})

This example is a single positional parameter which happens
to be a dictionary.

John Roth
>
> See that visual difference? I was talking just about that.
>
> --
> [ ] gminick (at) underground.org.pl  http://gminick.linuxsecurity.pl/
[ ]
> [ "Po prostu lubie poranna samotnosc, bo wtedy kawa smakuje
najlepiej." ]





More information about the Python-list mailing list