-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Python 3.9 is in security maintenance support, with the final update scheduled in 10-2025. The latest releases (3.9.20 at this time) are even available as an official binary, the latest binary released was 3.9.13. We also have Python 3.13 on the horizon (planned next month 10-2024).
I'm also considering after the next release (3.1.0) to completely remove support for Python 3.10 and 3.11 as well. Reasons for this:
- Much better typing syntax that cannot be backported through
typing_extensions - In particular, TypeVar syntax is much much cleaner in Python 3.12, allowing for removing a lot of boilerplate cruft involved
- Python 3.13 doesn't (yet) add any typing features that seem exceptionally nice. The biggest one looks like defaults for TypeVar and TypeVarTuple, but those aren't used in this library.
As an example, right now with Python 3.9 support:
from typing import TypeVarTuple, Generic, Unpack
Ts = TypeVarTuple('Ts')
class Serializer(Generic[Ts]):
...
def pack(self, *values: Unpack[Ts]) -> None:
...Becomes:
class Serializer[*Ts]:
...
def pack(self, *values: *Ts) -> None:
...With:
- Python 3.11 removing the need for
Unpack:Unpack[Ts]->*Ts - Python 3.12 removing the need for
GenericandTypeVarTuple, adding the in-line type var syntax.
The end result is much more readable code. Plus type_checking.py will receive a major code-line reduction, as most of the code in there except class _annotated is for handling cases where earlier Python version either don't have a feature, or the feature works differently.
So, after the next release (looking to put in #53 and #45) pull out Python 3.9 support and add in Python 3.13 support:
- Update
pyproject.tomlwith the PyPi metadata on supported versions - Update
.github/workflows/tests.yamlto remove Python 3.9 tests, add tests for Python 3.13. - Update branch protection to no longer require Python 3.9 tests
- Update branch protection to require Python 3.12 tests (missed when Python 3.12 released)
- Update docs to mention latest version supporting Python 3.9
Finally decide on going Python 3.12+
- Python 3.12+: removes lots of typing cruft.
- Keep Python 3.10, 3.11 support.