Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
What happened, or is happening, to other parts of the standard library? Why are they going missing?
In Python 3.12, I noticed that some libraries seem to be missing or "deprecated":
>>> import asynchat
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'asynchat'
>>> import cgi
<stdin>:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
I can still use cgi
but the warning is still there. I know that I saw these modules documented as part of the standard library before.
I know that distutils
, tkinter
and venv
are special cases, and that pip
isn't actually in the standard library. But what's up with these other modules? I checked with others and this seems to be reproducible in every distribution of Python 3.12.
1 answer
The following users marked this post as Works for me:
User | Comment | Date |
---|---|---|
Karl Knechtel | (no comment) | Jun 27, 2024 at 19:06 |
A handful of standard library modules either have been, or will soon be, removed from the Python standard library, as part of a general cleanup effort. These modules are seen as out of date and no longer useful, as they serve purposes that are not relevant today. The hope is that removing them will reduce maintenance burden for the core Python development team.
This effort started in Python 3.11 by adding deprecation notices for several modules that will be removed in 3.13. As well, asynchat
and asyncore
were removed in 3.12; they had been deprecated since 3.6, but without any concrete timeline for removal.
A complete list of changes, along with the rationale and other details, is given in PEP 594. It's worth noting that the original versions of some of these modules date as far back as 1992.
More generally, Python is adopting a consistent policy for removing deprecated functionality after a few minor versions. This, of course, is completely counter to the principles of semantic versioning (semver) - but Python was never actually intended to follow that policy anyway. To avoid further misunderstandings, there is currently a plan to transition Python to an explicit calendar versioning (calver) system, which is close to what they've been doing recently anyway.
0 comment threads