name=value) for those specific parameters. Introduced in Python 3.8 (PEP 570), they are defined in a function signature using a forward slash (/).
All parameters declared before the / are enforced as positional-only. Parameters declared after the / retain standard Python behavior (they can be passed by position or by keyword) unless further modified by other signature operators.
Syntax
Mechanics and Behavior
When a function is invoked, the Python interpreter maps the provided arguments to the signature. If an argument corresponding to a positional-only parameter is passed using keyword syntax, the interpreter raises aTypeError.
Signature Composition
The/ operator can be combined with the * operator (which enforces keyword-only parameters) to create a strictly partitioned function signature. This establishes clear boundaries for argument resolution:
pos_only: Must be passed by position./: Demarcates the end of positional-only parameters.standard: Can be passed by position or keyword.*: Demarcates the start of keyword-only parameters.kw_only: Must be passed by keyword.
Default Values
Positional-only parameters support default values. However, standard rules apply: a non-default positional-only parameter cannot follow a default positional-only parameter.Tired of Poor Python Skills? Fix That With Deep Grasping!Learn More





