Title: Using an underscore in the version portion of Python 3.10 compatibility tags
Author: Brett Cannon email@example.com,
Steve Dower firstname.lastname@example.org,
Barry Warsaw email@example.com
Type: Standards Track
Using the tag system outlined in :pep:
425 (primarily used for wheel
file names), each release of Python specifies compatibility tags
py39 for CPython 3.9). For CPython 3.10, this PEP
3_10 as the version portion of the tags
Up to this point, the version portion of compatibility tags used in
e.g. wheel file names has been a straight concatenation of the major
and minor versions of Python, both for the CPython interpreter tag and
the generic, interpreter-agnostic interpreter tag (e.g.
py39, respectively). This also applies to the ABI tag
cp39). Thanks to both the major and minor versions being
single digits, it has been unambiguous what which digit in e.g.
But starting with Python 3.10, ambiguity comes up as
310 does not
clearly delineate whether the Python version is
310 as the major-only version of Python. Thus using
separate major/minor portions as allowed by :pep:
the Python version being supported.
3_10 instead of another proposed separator is a restriction
425, thus the only options are
SOABI configure variable and
sysconfig.get_config_var('py_version_nodot') will be updated to
Tools relying on the ‘packaging’ project _ already expect a
version specification of
3_10 for Python 3.10. Keeping the version
310 would require backing that change out and
updating dependent projects (e.g. pip).
3_10 will impact any tools that implicitly rely on
the convention that the minor version is a single digit. However,
these are broken regardless of any change here.
For tools assuming the major version is only the first digit, they
will require updating if we switch to
In non-locale ASCII,
_ sorts after any digit, so lexicographic
sorting matching a sort by Python version of a wheel file name will be
Since PEP 515 (Python 3.6), underscores in numeric literals are ignored.
This means that
int("310") produce the same result,
and ordering based on conversion to an integer will be preserved.
However, this is still a bad way to sort tags, and the point is raised
here simply to show that this proposal does not make things worse.
There are no known security concerns.
How to Teach This
As use of the interpreter tag is mostly machine-based and this PEP
disambiguates, there should not be any special teaching consideration
A pull request _ already exists adding support to CPython 3.10.
Support for reading wheel files with this proposed PEP is already
Not making the change
It was considered to not change the tag and stay with
argument was it’s less work and it won’t break any existing
tooling. But in the end it was thought that the disambiguation is
better to have.
How far should we take this?
Other places where the major and minor version are used could be
updated to use an underscore as well (e.g.
.pyc files, the import
path to the zip file for the stdlib). It is not known how useful it
would be to make this pervasive.
…  Reference implementation
…  The ‘packaging’ project
This document is placed in the public domain or under the
CC0-1.0-Universal license, whichever is more permissive.