[Python-Dev] PEP 457: Syntax For Positional-Only Parameters

Nick Coghlan ncoghlan at gmail.com
Wed Oct 9 11:46:14 CEST 2013


The PEP needs to state more clearly up front (preferably in the title) that
it's about *reserving* a Python level syntax that matches the syntax we
worked out for Argument Clinic at PyCon US. Explicitly stating that the
requirements that drive the Argument Clinic design are to support the
signature of all current CPython builtins and extension modules would also
be helpful.

Generally, it needs to be a bit clearer that the intent of the PEP isn't to
say "let's do this", it's to be explicit that acceptance of the Argument
Clinic PEP severely constrains the design space for possible solutions if
we ever *did* implement Python level support for positional only arguments.

A few other specific points:

- parameters in optional groups should just have an implied "=None" that
can be overriden if desired.

- parsing positional only args in Python is actually pretty easy in most
cases, as you can just use a second private function to do the heavy
lifting.

- a simpler variant that omits the grouping support and only allows
optional parameters on the right should also be reserved

- explicitly delegate to the argument clinic PEP for the impact on
inspect.Signature

Cheers,
Nick.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20131009/628ce6c1/attachment.html>


More information about the Python-Dev mailing list