Single and double asterisks preceding variables in function arguments

anton muhin antonmuhin at rambler.ru
Mon Jan 26 11:45:35 EST 2004


Stephen Boulet wrote:
> I've run across code like "myfunction(x, *someargs, **someotherargs)", 
> but haven't seen documentation for this.
> 
> Can someone fill me in on what the leading * and ** do? Thanks.
> 
> Stephen

See item 7.5 in Language Reference. In short: * declaries list of 
additional parameters, while ** declares map of additional parameters. 
Try somehting like:

	def foo(*params): print params

and

	def bar(**params): print params

to find out details.

regards,
anton.



More information about the Python-list mailing list