Is it explicitly specified?

Terran Melconian te_rem_ra_ove_an_forspam at consistent.org
Tue Feb 5 14:43:27 EST 2008


>> Exactly, and if you use idiom func(*args, **kwargs) you can distinguish
>> all the usage cases:
>>
>>  >>> def func(*args, **kwargs):
>
> Nice... but I would still like to be able to specify the key's default
> value in the func signature, and in this case this would not be

The workaround I have seen for this is to simply put an alternative
function signature in the docstring.  Wx, for example, takes this
approach to document the default values for things that actually arrive
in **kwargs.  For an example, look at wx.Frame.__init__.  It looks a
little awkward but it's perfectly clear what it means and why it was
done.



More information about the Python-list mailing list