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

Georg Brandl g.brandl at gmx.net
Sat Mar 3 22:29:27 CET 2012


On 03.03.2012 21:11, Terry Reedy 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

I don't think that is a good idea. We currently put argument default
values in the function signatures in Python syntax, but only because
that also makes sense from a documentation PoV.
We also wouldn't write
 @property
 name(self)
just because that's (one) way for creating properties from Python.
Georg
(I am -0 on @positional myself: IMO such a completely different way
of declaring positional-only and keyword-only arguments lacks grace.)


More information about the Python-ideas mailing list

AltStyle によって変換されたページ (->オリジナル) /