[Python-ideas] keyword arguments everywhere (stdlib) - issue8706

Guido van Rossum guido at python.org
Sat Mar 3 21:39:32 CET 2012

On Sat, Mar 3, 2012 at 12:11 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> On 3/3/2012 12:54 PM, Guido van Rossum wrote:
>> Anyway, I now think that adding a built-in @positional(N) decorator
>> makes the most sense since it doesn't require changes to the parser.
>> The built-in can be implemented efficiently. This should be an easy
>> patch for someone who wants to contribute some C code.
> Would you then be okay with using that in documentation?
> @positional(1)
> ord(char)
> Return the integer code for char
> If you prefer that to
> ord(char, /)
> Return the integer code for char
> fine with me.

The @positional(1) form looks like it would be easier to understand if
you aren't familiar with it than the / form.

> I care more about being able to document existing apis for
> C-implemented functions than about being able to limit Python functions I
> write. (Of course, being able to make C and Python versions of stdlib
> modules match would also be great!) Currently, one may need to experiment
> before using name-passing to be sure it will work, which tends to discourage
> name-passing of args even when it would be more readable.

Yeah, so it does make sense to standardize on a solution for this. Let
it be @positional(N). Can you file an issue?

--Guido van Rossum (python.org/~guido)

More information about the Python-ideas mailing list