In article <[EMAIL PROTECTED]>, Dave Hansen <[EMAIL PROTECTED]> wrote: >On 20 Mar 2006 12:46:43 -0800 in comp.lang.python, "J Rice" ><[EMAIL PROTECTED]> wrote: >> >>I'm sorry for such a basic question, but I haven't been able to phrase >>a search that gets me an answer and my books are totally silent on >>this. I have seen a number of python function defs that take >>parameters of the form (**param1). Looks like a pointer... but my >>books on python (basic as they are) don't make a mention. What is >>this? > >It's a way of accepting a varying number of named arguments. In the >function, the parameter becomes a dictionary with parameter names as >the keys corresponding to the passed parameter values. > >It's harder to explain than understand. Try playing with the >following function in the python interpreter: > > def test(a,b='b', *c, **d): > print a,b,c,d
Personally, I think it's a Good Idea to stick with the semi-standard names of *args and **kwargs to make searching easier... -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "19. A language that doesn't affect the way you think about programming, is not worth knowing." --Alan Perlis -- http://mail.python.org/mailman/listinfo/python-list