[Python-Dev] Positional-only Arguments

Benji York benji at benjiyork.com
Tue May 2 22:59:06 CEST 2006


Terry Reedy wrote:
> You could discourage name use by not documenting the actual, internal name 
> of the parameters.

The issue we had was that the name wasn't documented at all, the users 
simply looked at the code and began using the keyword name.  This may 
well be an area where "we're all adults here" wins.

OTOH there is a /slight/ possibility that it'd be better to disallow 
using an argument as a keyword unless explicitly flagged as such. 
Similar to how the C API works now.

This has the same advantages of the keyword-only PEP (3102): tools will 
know which arguments are positional and which are keyword.  Doing so 
would recast PEP 3102 from "how to get a keyword-only argument" into 
"how to get a keyword (non-positional) argument".  A downside would be 
the need to specify when an argument can be positional *or* keyword.
--
Benji York


More information about the Python-Dev mailing list