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

Paul Moore p.f.moore at gmail.com
Wed Oct 9 18:05:12 CEST 2013


On 9 October 2013 16:07, Larry Hastings <larry at hastings.org> wrote:
> On 10/09/2013 04:38 PM, Paul Moore wrote:
>
> For that matter, why does the syntax used by Argument Clinic have to
> be the same as whatever future syntax is used in Python? If indeed,
> any ever is? What benefit do we get given the cost (rushing in a
> syntax that nobody is actually convinced we even need in Python yet).
>
> In other words, why does PEP this need to be separated out from the
> Argument Clinic PEP at all?
>
>
> I propose to use this syntax in three places:
>
> As input to Argument Clinic.
> As input to the Python C API, to express the metadata for builtins.
> As the first line of output of pydoc (aka "help()") when reviewing a
> function.
>
> Of these, 3 is visible to users.  Theoretically all of them could use
> different syntaxes.  But consistency is desirable, so it would be better if
> these syntaxes were as similar as possible.

OK, all of those are reasonable points. I'm still -0 because I find
the proposed syntax ugly, but I can't offer a better syntactic
solution. My proposal is to hide the ugly syntax internally, and use
prose documentation where users can see. You may disagree, that's
fine.

>  Python syntax works well for
> all three syntaxes, except it does not support positional-only parameters.
> It seemed reasonable to codify twenty-year old practice in a syntax
> extension that I could use in all of the above.

I remain -1 on forcing "Python syntax" to support all of these odd
corner cases (and positional-only is already a corner case,
range/addch are seriously so).

I don't see any reason for the proposal to mandate that the arguments
made here should apply to any future changes to core Python syntax.
Either we have the debate now, or we agree that the proposal doesn't
apply to Python.

Anyway, thanks for clarifying your position. I'm happy that I
understand what you're proposing now, even if I don't agree with you
:-) I presume you'll incorporate the various pieces of feedback into a
revised version of the PEP that explains the purpose a bit more
clearly.

Paul


More information about the Python-Dev mailing list