arguments to functions

Chris Liechti cliechti at
Sun Jun 30 19:16:19 CEST 2002

Uwe Mayer <merkosh at> wrote in 
news:MPG.178955a4fc8bfc1c989680 at
> I wanted to pass one named and a collection of unnamed (an arbitrary 
> number) to a function:

def f(*args, **kwargs):
    	print "positional args:", args
    	print "keyword args:", kwargs
    	if kwargs.has_attr("expected"):
    	    	print "Expected was set to", kwargs["expected"]

does that help somehow? :-)


Chris <cliechti at>

More information about the Python-list mailing list