A Python Enhancement Proposal (PEP) 594, proposed by Python contributors Christian Heimes and Brett Cannon, to remove obsolete and unmaintained modules from the Python standard library, has been approved. -0594) has been approved for adoption. This proposal was originally submitted in 2019, but was only recently (March 11) approved for Python 3.11. With this PEP, Python 3.11 will mark certain modules as deprecated, and Python 3.12 will be the last release to include them. In Python 3.13, modules that are not recommended for use will be removed entirely.
This PEP presents a list of standard library modules to be removed from the standard library. Most of these modules are historical data formats (e.g. Commodore and SUN file formats), APIs and operating systems that have long been superseded (e.g. Mac OS 9), or modules that have security concerns and better alternatives (e.g. passwords and logins).
Python has always had a “batteries included” philosophy; the goal is to provide a common standard library to handle many common development tasks without users having to figure out how to download and install separate packages in order to write a simple web server or parse email.
But as times have changed, downloading and installing packages has become straightforward with the introduction of PyPI (née Cheeseshop), setuptools, and pip, and Python now has a rich and vibrant ecosystem of third-party packages. On the other hand, Python’s standard libraries are cluttered with unnecessary duplication of functionality and dispensable features. For this reason, the official view is that
- Any additional modules would increase the maintenance costs for Python’s core development team. Teams have limited resources, and the reduced maintenance costs free up development time for other improvements.
- Modules in the standard library are often favored and seen as practical solutions to problems. Most users choose third-party modules to replace stdlib modules only when there is a compelling reason to do so, for example, replacing
xml
withlxml
. Removing unmaintained stdlib modules increases the chances that community-contributed modules will be widely used. - A streamlined standard library benefits platforms with limited resources, such as devices with only a few hundred KB of storage (e.g., BBC Micro:bit). python on mobile platforms such as BeeWare or WebAssembly (e.g., pyodide) also benefits from fewer downloads.
The modules deprecated in this PEP are either because their removal was the least controversial or the most beneficial. For example, the least controversial are 30-year-old multimedia formats such as sunau audio format, which was used in SPARC and NeXT workstations in the late 80s. The crypt
module has fundamental flaws that could be better addressed outside the standard library.
In addition, the PEP also designates some modules as not scheduled for removal. Some of these modules have been deprecated for several versions, or may not seem necessary at first glance. However, it is beneficial to keep these modules in the standard library, mainly for environments where packages cannot be installed from PyPI; this includes the ftplib, optparse, getopt, and wave modules.
CPython core developer Gregory P. Smith stated in the discussion thread for approving the PEP that PEP-594 removes a set of uncontroversial, very old, unmaintained, or obsolete libraries from the Python standard library. the Python Steering The committee expects this PEP to be a one-time event, and that future deprecations will be handled differently.
“Addressing the ongoing discussion around how we define stdlib over time does not preclude this PEP. It seems worthwhile for us to do a periodic review of the contents of stdlib every few releases so that we can avoid accumulating so many dead batteries, but that is beyond the scope of this particular PEP. "