[Python-Dev] Positional-only parameters in Python
Nick Coghlan
ncoghlan at gmail.com
Thu Jan 18 00:14:55 EST 2018
On 18 January 2018 at 03:16, Sanyam Khurana <sanyam.khurana01 at gmail.com> wrote:
> On Wed, Jan 17, 2018 at 8:04 PM, Victor Stinner
> <victor.stinner at gmail.com> wrote:
>> It seems like a PEP is needed.
>
> I followed the threads mentioned above, which led me to PEP 457:
> https://www.python.org/dev/peps/pep-0457/
>
> I didn't find a clear indication if it was still to be modified,
> approved or rejected. Can anyone help?
Effectively deferred, since Guido decided we didn't need a PEP for the
__text_signature__ syntax in the inspect module:
>>> import inspect
>>> inspect.signature(ord)
<Signature (c, /)>
>>> ord.__text_signature__
'($module, c, /)'
(The motivation was to give Argument Clinic a way to communicate C
level signatures up to Python code)
A PEP for Python level positional-only argument syntax would be able
to rely on Signature.__repr__ and __text_signature__ as precedent for
using "/" to indicate that the preceding parameters are
positional-only, though.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev
mailing list