Optional Parameter Requirements

Bruno Desthuilliers onurb at xiludom.gro
Mon Oct 30 05:05:19 EST 2006


dhable at gmail.com wrote:
> If I'm building a function to accept optional parameters, do I need to
> allow for the capture of both the positional arguments as well as the
> keyword arguments?

No.

> If it doesn't make sense to allow keyword arguments,
> can I just write:
> 
> def myfunc(a, b, *tup):
>   ...
> 
> and be done with it?

Yes.


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list