PEP 570
E893187
PEP 570 is the Python Enhancement Proposal that introduced positional-only parameters to Python function definitions, formalizing a syntax for arguments that must be passed by position.
Statements (47)
| Predicate | Object |
|---|---|
| instanceOf | Python Enhancement Proposal ⓘ |
| addsConcept |
keyword-only parameters after * marker
ⓘ
positional-only parameters before / marker ⓘ positional-or-keyword parameters after / and before * ⓘ |
| affects |
Python call semantics
ⓘ
Python function definitions ⓘ |
| author |
Brett Cannon
NERFINISHED
ⓘ
Guido van Rossum NERFINISHED ⓘ Pablo Galindo NERFINISHED ⓘ Raymond Hettinger NERFINISHED ⓘ Serhiy Storchaka NERFINISHED ⓘ Steven D'Aprano NERFINISHED ⓘ Victor Stinner NERFINISHED ⓘ Yury Selivanov NERFINISHED ⓘ Łukasz Langa NERFINISHED ⓘ |
| benefit |
allows hiding parameter names from public API
ⓘ
can make some function calls faster by simplifying argument parsing ⓘ supports compatibility with existing C APIs that are positional-only ⓘ |
| category | Core Python language change ⓘ |
| clarifies |
error messages for incorrect use of positional-only parameters
ⓘ
how positional-only parameters interact with *args and **kwargs ⓘ |
| createdFor | Python programming language NERFINISHED ⓘ |
| definesSyntaxFor | positional-only parameters in function definitions ⓘ |
| discussionsTo | python-dev mailing list NERFINISHED ⓘ |
| exampleSyntax | def func(a, b, /, c, d, *, e, f): ... ⓘ |
| formalizes | syntax for arguments that must be passed by position ⓘ |
| implementationDetail | adds new internal calling convention flags ⓘ |
| implementedIn | CPython NERFINISHED ⓘ |
| introducedIn | Python 3.8 NERFINISHED ⓘ |
| introduces | positional-only parameters in Python ⓘ |
| language | English ⓘ |
| motivation |
allow APIs to clearly separate positional-only and keyword parameters
ⓘ
enable more consistent and efficient C-API to Python function mappings ⓘ improve backward compatibility when changing parameter names ⓘ |
| prohibits | passing positional-only parameters by keyword ⓘ |
| relatedTo |
PEP 3102
NERFINISHED
ⓘ
keyword-only arguments ⓘ |
| repository | Python PEPs repository ⓘ |
| requires |
/ marker to appear at most once in a parameter list
ⓘ
positional-only parameters to precede other parameters ⓘ |
| specifies |
how help() and introspection show positional-only parameters
ⓘ
how inspect.signature represents positional-only parameters ⓘ |
| status | Final ⓘ |
| targetVersion | Python 3.x NERFINISHED ⓘ |
| title | Python Positional-Only Parameters NERFINISHED ⓘ |
| type | Standards Track ⓘ |
| usesMarker | forward slash (/) in function parameter lists ⓘ |
Referenced by (1)
Full triples — surface form annotated when it differs from this entity's canonical label.