parameter list notation

Duncan Booth duncan.booth at invalid.invalid
Tue Sep 4 09:37:49 CEST 2007


TheFlyingDutchman <zzbbaadd at aol.com> wrote:

> I am trying to use a database written in Python called buzhug.
> 
> In looking at some of the functions I see this prototype:
> 
>     def create(self,*fields,**kw):
> 
> I am not clear on what the * and the ** are for or what they
> represent. Or, what are they referred to as so I can do a query for
> information on them.
> 
You could try searching for 'function definitions'. That might lead you to 
http://docs.python.org/ref/function.html "Python Reference Manual, 7.6 
Function definitions":

> Function call semantics are described in more detail in section 5.3.4.
> A function call always assigns values to all parameters mentioned in
> the parameter list, either from position arguments, from keyword
> arguments, or from default values. If the form ``*identifier'' is
> present, it is initialized to a tuple receiving any excess positional
> parameters, defaulting to the empty tuple. If the form
> ``**identifier'' is present, it is initialized to a new dictionary
> receiving any excess keyword arguments, defaulting to a new empty
> dictionary. 



More information about the Python-list mailing list