This PEP proposes a syntax for positional-only parameters in Python.
Positional-only parameters are parameters without an externally-usable
name; when a function accepting positional-only parameters is called,
positional arguments are mapped to these parameters based solely on
their position.

Python has always supported positional-only parameters.
Early versions of Python lacked the concept of specifying
parameters by name, so naturally all parameters were
positional-only. This changed around Python 1.0, when
all parameters suddenly became positional-or-keyword.
This allowed users to provide arguments to a function both
positionally or referencing the keyword used in the definition
of it. But, this is not always desired nor even available as
even in current versions of Python, many CPython
"builtin" functions still only accept positional-only arguments.

Even if positional arguments only in a function can be achieved
via using *args parameters and extracting them one by one,
the solution is far from ideal and not as expressive as the one
proposed in this PEP, which targets to provide syntax to specify
accepting a specific number of positional-only parameters.
Additionally, this will bridge the gap we currently find between
builtin functions that today allows to specify positional-only
parameters and pure Python implementations that lack the
syntax for it.

There are many, many examples of builtins that only
accept positional-only parameters. The resulting
semantics are easily experienced by the Python
programmer--just try calling one, specifying its
arguments by name:

Pow clearly expresses that its arguments are only positional
via the / marker, but this is at the moment only documentational,
Python developers cannot write such syntax.

In addition, there are some functions with particularly
interesting semantics:

range(), which accepts an optional parameter
to the left of its required parameter. [2]

dict(), whose mapping/iterator parameter is optional and
semantically must be positional-only. Any externally
visible name for this parameter would occlude
that name going into the **kwarg keyword variadic
parameter dict! [1]

Obviously one can simulate any of these in pure Python code
by accepting (*args, **kwargs) and parsing the arguments
by hand. But this results in a disconnect between the
Python function signature and what it actually accepts,
not to mention the work of implementing said argument parsing.

One more important idea to consider: currently in the documentation
there's no way to tell whether a function takes positional-only
parameters. open() accepts keyword arguments, ord() does
not, but there is no way of telling just by reading the
documentation that this is true.

All parameters before the / are positional-only. If / is
not specified in a function signature, that function does not
accept any positional-only parameters.
The logic around optional values for positional-only argument
Remains the same as the one for positional-or-keyword. Once
a positional-only argument is provided with a default,
the following positional-only and positional-or-keyword argument
need to have a default as well. Positional-only parameters that
don’t have a default value are "required" positional-only parameters.
Therefore the following are valid signatures:

Modifying marshal.c to account for the modifications of the code object.

This does not intend to be a guide or a comprehensive recipe on how to implement
this but a rough outline of the changes this will make to the codebase.

The advantages of this implementation involve speed, consistency with the
implementation of keyword-only parameters as in PEP 3102 and a simpler implementation
of all the tools and modules that will be impacted by this change.

It is not until you reach the end of the signature that the reader
realized the / and therefore the fact that the arguments are
position-only. This deviates from how the keyword-only marker works.

That said we could not find an implementation that would modify the
arguments after the marker, as that will force the one before the
marker to be position only as well. Example:

def (x, y, /, z):

If we define that / makes only z position-only it won't be possible
to call x and y via keyword argument. Finding a way to work around it
will add confusion given that at the moment keyword arguments cannot be
followed by positional arguments. / will therefore make both the
preceding and following position-only.

It has been suggested on python-ideas [8] to provide
a decorator written in Python as an implementation for this feature. This approach
has the advantage that keeps parameter declaration more easy to read but also
introduces an asymmetry on how parameter behaviour is declared. Also, as the /
syntax is already introduced for C functions, this inconsistency will make more
difficult to implement all tools and modules that deal with this syntax including
but not limited to, the argument clinic, the inspect module and the ast module.
Another disadvantage of this approach is that calling the decorated functions
will be slower than the functions generated if the feature was implemented directly
in C.