PEP‑594: Removing Dead Batteries from the Python Standard Library
PEP‑594, approved for Python 3.11‑3.13, removes over‑aged and unmaintained modules from the standard library, revitalizing the language’s “batteries‑included” philosophy by reducing maintenance costs, improving security, and benefiting resource‑constrained platforms while also streamlining future development.
Python’s long‑standing “batteries included” philosophy means the language ships with more than 200 standard‑library modules that work out‑of‑the‑box.
After three decades many of these modules have become obsolete or insecure, prompting the community to draft PEP‑594 in 2019 to prune the standard library.
The proposal was finally accepted, and the cleanup will be staged from Python 3.11 through 3.13, with deprecation warnings in 3.11, removal in 3.12, and complete elimination in 3.13.
Benefits include lower maintenance overhead for the core team, encouragement of better‑maintained third‑party alternatives, and a smaller footprint for devices with limited storage such as micro‑controllers or WebAssembly runtimes.
Removing rarely used modules frees core developers to focus on high‑impact improvements.
When a third‑party library offers a superior solution (e.g., lxml instead of xml ), the standard library can be safely trimmed.
A leaner stdlib aids resource‑constrained platforms like the BBC Micro:bit or Pyodide.
Some modules are being dropped because they are outdated (e.g., old multimedia formats) or have security flaws, such as the crypt module.
Conversely, a few modules—such as ftplib , optparse , getopt , and wave —will remain because they are essential for environments that cannot rely on external packages.
Core developer Gregory P. Smith noted that PEP‑594 represents a one‑off cleanup, with future deprecations to be handled through a regular review process to avoid the accumulation of “dead batteries.”p>
Python Programming Learning Circle
A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.