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

Guido van Rossum guido at python.org
Fri Mar 2 23:18:58 CET 2012


On Fri, Mar 2, 2012 at 2:01 PM, Gregory P. Smith <greg at krypto.org> wrote:
>
> On Fri, Mar 2, 2012 at 12:00 PM, Guido van Rossum <guido at python.org> wrote:
>>
>> I've written such decorators too, but they've got quite a bit of
>> overhead...
>
> yeah those fall into the gross hacks I alluded to in my original post. ;)
>
> I intentionally decided to leave out discussion of "should we allow
> positional-only arguments to be declared in Python" but it is a valid
> discussion and thing to consider...

I just want to remain realistic and acknowledge that positional
arguments have their place.

> if we go that route, could it be possible to implement range([start=0, ]
> stop[, step=1]) such that they are positional only but mutliple arguments
> are treated different than strictly sequential without writing conditional
> code in Python to figure out each one's meaning at runtime.

Eew, I don't think this pattern is useful enough to support in syntax,
even if one of the most popular builtins (but only one!) uses it.

> speaking of range... I think start and stop are plenty obvious, but I'd like
> to allow step to be specified as a keyword.

That's fine, range() is not overloadable anyway.

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



More information about the Python-ideas mailing list