[Tutor] variable number of inputs
Alan Gauld
alan.gauld at btinternet.com
Thu Jan 8 10:22:07 CET 2009
"wesley chun" <wescpy at gmail.com> wrote
> a very popular idiom you'll see in function signatures looks like
> this:
>
> def func(*args, **kwargs)
>
> this is the most flexible Python function definition because this
> function can accept *any* number and type of arguments you can give
But the caveat: With power comes responsibility. You need to make
sure your function can cope with this potential wealth of data being
thrown at it! Othewise its all a bit pointless! :-)
--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld
More information about the Tutor
mailing list