This PEP is rejected for failure to generate significant interest.
This PEP proposes strategies to allow the Python standard libraryto be upgraded in parts without having to reinstall the completedistribution or having to wait for a new patch level release.
Python currently does not allow overriding modules or packages inthe standard library per default. Even though this is possible bydefining aPYTHONPATH environment variable (the paths defined inthis variable are prepended to the Python standard library path),there is no standard way of achieving this without changing theconfiguration.
Since Python’s standard library is starting to host packages whichare also available separately, e.g. the distutils, email and PyXMLpackages, which can also be installed independently of the Pythondistribution, it is desirable to have an option to upgrade thesepackages without having to wait for a new patch level release ofthe Python interpreter to bring along the changes.
On some occasions, it may also be desirable to update modules ofthe standard library without going through the whole Python releasecycle, e.g. in order to provide hot-fixes for security problems.
This PEP proposes two different but not necessarily conflictingsolutions:
sys.path:$stdlibpath/system-packages just before the$stdlibpathentry. This complements the already existing entry for siteadd-ons$stdlibpath/site-packages which is appended to thesys.path at interpreter startup time.To make use of this new standard location, distutils will needto grow support for installing certain packages in$stdlibpath/system-packages rather than the standard locationfor third-party packages$stdlibpath/site-packages.
$stdlibpath for thesystem upgrades rather than into$stdlibpath/site-packages.The first solution has a few advantages over the second:
$stdlibpath/system-packages)The only advantages of the second approach are that the Pythoninterpreter does not have to changed and that it works witholder Python versions.
Both solutions require changes to distutils. These changes canalso be implemented by package authors, but it would be better todefine a standard way of switching on the proposed behaviour.
Solution 1: Python 2.6 and up
Solution 2: all Python versions supported by distutils
None
None
This document has been placed in the public domain.
Source:https://github.com/python/peps/blob/main/peps/pep-0297.rst
Last modified:2025-02-01 08:55:40 GMT