Function arguments

Martin Franklin martin.franklin at westgeo.com
Thu Oct 18 11:39:44 CEST 2001


Thomas Heller wrote:

> Call me weird, but sometimes I need functions taking a number of
> positional arguments, some named arguments with default values, and
> other named arguments as well.
> 
> Something like this (which does _not_ work):
> 
> def function(*args, defarg1=None, defarg2=0, **kw):
>     ...


-- snip --


What about this:

def function(defarg1=None, defarg2=0, *args, **kw):


Martin



More information about the Python-list mailing list