[Python-Dev] PEP 457: Syntax For Positional-Only Parameters (original) (raw)

Ethan Furman ethan at stoneleaf.us
Wed Oct 9 07:13:13 CEST 2013


On 10/08/2013 09:55 PM, Benjamin Peterson wrote:

2013/10/8 Ethan Furman <ethan at stoneleaf.us>:

On 10/08/2013 08:09 PM, Benjamin Peterson wrote:

2013/10/8 Terry Reedy <tjreedy at udel.edu>:

On 10/8/2013 9:31 PM, Benjamin Peterson wrote:

2013/10/8 Larry Hastings <larry at hastings.org>:

This PEP proposes a backwards-compatible syntax that should permit implementing any builtin in pure Python code.

This is rather too strong. You can certainly implement them; you just have to implement the argument parsing yourself. Python's call/signature syntax is already extremely expressive, and resolving call arguments to formal parameters is already a complicated (and slow) process. Implementing functions with such strange argument semantics is hardly common enough to justify the whole grouping syntax proposed in this PEP. -1 to that. I think I can live with "/", but YANGTNI still. I am for having a way to succintly properly describe the signature of C in the manual and docstrings and help output. As it is now, the only safe thing to do, without trial and exception, is to assume positional only unless one knows otherwise. Having a nice syntax for the docs is quite different from implementing it in the language. It would be nice, however, to have it implemented at some point. Why? It's quite complex and hardly useful.

Hmmm...... Let me get back to you on that. ;)

-- Ethan



More information about the Python-Dev mailing list