[Python-Dev] Formatting of positional-only parameters in signatures

Yury Selivanov yselivanov.ml at gmail.com
Tue Jan 21 18:51:34 CET 2014


Terry,

On January 21, 2014 at 12:23:31 PM, Terry Reedy (tjreedy at udel.edu) wrote:
> > On 1/21/2014 10:59 AM, Yury Selivanov wrote:
> > There is one more, hopefully last, open urgent question with  
> the signature
> > object. At the time we were working on the PEP 362, PEP 457 didn’t  
> > exist. Nor did we have any function with real positonal-only  
> parameters,
> > since there was no Argument Clinic yet. However, I implemented  
> > rudimentary support for them:
> >
> > “Parameter.POSITIONAL_ONLY” constant;
> >
> > “Signature.bind” and “Signature.bind_partial” fully support  
> functions
> > with positional-only parameters;
> >
> > “Signature.__str__” renders them distinctively from other  
> kinds.
> >
> > The last point is the troublesome now. "Signature.__str__”  
> renders
> > positional-only parameters in ‘<>’ brackets, so in:
> >
> > foo(, , baz)
>  
> This amounts to a hidden new API.

Yes, and no. This wasn’t documented and until 3.4 we had no real-world
positonal-only parameters. So I think it’s OK to fix this now.

Yury


More information about the Python-Dev mailing list