parameter list notation
Steve Holden
steve at holdenweb.com
Tue Sep 4 01:58:37 EDT 2007
TheFlyingDutchman wrote:
> Well I did a search on "Python variable length arguments" and found a
> hit that seems to explain the *fields parameter:
>
> When you declare an argment to start with '*', it takes the argument
> list into an array.
>
> def foo(*args):
> print "Number of arguments:", len(args)
> print "Arguments are: ", args
>
>
Well done. The ** notation allows you to collect arbitrary keyword
arguments into a dictionary (whose name is kw in the example you gave).
With such a formal parameter any keyword argument is acceptable for a
call (unless it duplicates a key value).
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------
More information about the Python-list
mailing list