[Python-ideas] keyword arguments everywhere (stdlib) - issue8706
Guido van Rossum
guido at python.org
Sun Mar 4 19:15:50 CET 2012
On Sun, Mar 4, 2012 at 9:20 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
> If I understand correctly, there is no way to have positional-only,
> position-or-keyword, and keyword-only in the same signature?
Heh. If that's true, my '/' proposal wins:
def foo(pos_only, /, pos_or_kw, *, kw_only): ...
Defaults can be added to taste.
The restrictions on args-without-defaults being unable to follow
args-with-defaults may need to be revisited so we can combine optional
positional arguments with required keyword arguments, if we want to
Nevertheless all this is pretty esoteric and I wouldn't cry if it
wasn't added. There exist solutions for the Mapping-API problem, and a
@positional decorator would cover most other cases.
--Guido van Rossum (python.org/~guido)
More information about the Python-ideas