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

Larry Hastings larry at hastings.org
Wed Oct 9 16:15:36 CEST 2013


On 10/09/2013 11:46 AM, Nick Coghlan wrote:
> 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. 

Can you suggest an edit that would make you happy?

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

No no no!  You can't have a default value, and you definitely couldn't 
use None.

range() decides what its arguments mean based on how many arguments it 
receives.  If I understand your proposal correctly, you suggest that

    range(None, 5)

would return the same result as

    range(5)

But that's simply not how it works.

If you want to propose changing the semantics of range, go ahead, I'll 
stand back.

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

If that syntax is a subset of this syntax, and this syntax is reserved, 
then by extension we would automatically reserve that syntax too.  In 
any other circumstance (this PEP is rejected, the simpler variant uses a 
different syntax) the simpler syntax should get a new PEP.

I'll just say that that syntax is insufficient to implement existing 
functions we all know and love (addch, range).


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

I'd actually rather do it the other way 'round.  This PEP is a better 
place for it.  Even though I think the Clinic PEP has a higher chance of 
being accepted ;-)


//arry/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20131009/5243fe1c/attachment.html>


More information about the Python-Dev mailing list