2000-10-04 18:40:30 -04:00
|
|
|
|
PEP: 4
|
|
|
|
|
Title: Deprecation of Standard Modules
|
|
|
|
|
Version: $Revision$
|
2006-03-23 15:13:19 -05:00
|
|
|
|
Last-Modified: $Date$
|
2007-06-28 16:03:18 -04:00
|
|
|
|
Author: Martin von Löwis <martin@v.loewis.de>
|
2000-10-04 18:40:30 -04:00
|
|
|
|
Status: Active
|
2007-06-19 00:52:34 -04:00
|
|
|
|
Type: Process
|
2013-10-12 12:11:53 -04:00
|
|
|
|
Content-Type: text/x-rst
|
2000-10-04 18:40:30 -04:00
|
|
|
|
Created: 1-Oct-2000
|
2007-06-19 00:20:07 -04:00
|
|
|
|
Post-History:
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
|
2000-10-04 18:40:30 -04:00
|
|
|
|
Introduction
|
2013-10-12 12:11:53 -04:00
|
|
|
|
============
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
When new modules were added to the standard Python library in the
|
|
|
|
|
past, it was not possible to foresee whether they would still be
|
|
|
|
|
useful in the future. Even though Python "Comes With Batteries
|
|
|
|
|
Included", batteries may discharge over time. Carrying old modules
|
|
|
|
|
around is a burden on the maintainer, especially when there is no
|
|
|
|
|
interest in the module anymore.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
At the same time, removing a module from the distribution is
|
|
|
|
|
difficult, as it is not known in general whether anybody is still
|
|
|
|
|
using it. This PEP defines a procedure for removing modules from the
|
|
|
|
|
standard Python library. Usage of a module may be 'deprecated', which
|
|
|
|
|
means that it may be removed from a future Python release. The
|
|
|
|
|
rationale for deprecating a module is also collected in this PEP. If
|
|
|
|
|
the rationale turns out faulty, the module may become 'undeprecated'.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Procedure for declaring a module deprecated
|
2013-10-12 12:11:53 -04:00
|
|
|
|
===========================================
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
Since the status of module deprecation is recorded in this PEP,
|
|
|
|
|
proposals for deprecating modules MUST be made by providing a change
|
|
|
|
|
to the text of this PEP, which SHOULD be a patch posted to
|
|
|
|
|
bugs.python.org.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
A proposal for deprecation of the module MUST include the date of the
|
|
|
|
|
proposed deprecation and a rationale for deprecating it. In addition,
|
|
|
|
|
the proposal MUST include a change to the documentation of the module;
|
|
|
|
|
deprecation is indicated by saying that the module is "obsolete" or
|
|
|
|
|
"deprecated". The proposal SHOULD include a patch for the module's
|
|
|
|
|
source code to indicate deprecation there as well, by raising a
|
|
|
|
|
DeprecationWarning. The proposal MUST include patches to remove any
|
|
|
|
|
use of the deprecated module from the standard library.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
It is expected that deprecated modules are included in the Python
|
|
|
|
|
releases that immediately follows the deprecation; later releases may
|
|
|
|
|
ship without the deprecated modules.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Procedure for declaring a module undeprecated
|
2013-10-12 12:11:53 -04:00
|
|
|
|
=============================================
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
When a module becomes deprecated, a rationale is given for its
|
|
|
|
|
deprecation. In some cases, an alternative interface for the same
|
|
|
|
|
functionality is provided, so the old interface is deprecated. In
|
|
|
|
|
other cases, the need for having the functionality of the module may
|
|
|
|
|
not exist anymore.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
If the rationale is faulty, again a change to this PEP's text MUST be
|
|
|
|
|
submitted. This change MUST include the date of undeprecation and a
|
|
|
|
|
rationale for undeprecation. Modules that are undeprecated under this
|
|
|
|
|
procedure MUST be listed in this PEP for at least one major release of
|
|
|
|
|
Python.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Obsolete modules
|
2013-10-12 12:11:53 -04:00
|
|
|
|
================
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
A number of modules are already listed as obsolete in the library
|
|
|
|
|
documentation. These are listed here for completeness.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
cl, sv, timing
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
All these modules have been declared as obsolete in Python 2.0, some
|
|
|
|
|
even earlier.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
The following obsolete modules were removed in Python 2.5:
|
2006-03-16 01:58:39 -05:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt,
|
|
|
|
|
grep, lockfile, newdir, ni, packmail, Para, poly,
|
|
|
|
|
rand, reconvert, regex, regsub, statcache, tb, tzparse,
|
|
|
|
|
util, whatsound, whrandom, zmod
|
2006-03-16 01:58:39 -05:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
The following modules were removed in Python 2.6:
|
2007-05-16 18:46:19 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
gopherlib, rgbimg, macfs
|
2007-05-16 18:46:19 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
The following modules currently lack a DeprecationWarning:
|
2007-05-16 01:27:37 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
rfc822, mimetools, multifile
|
2007-05-16 01:27:37 -04:00
|
|
|
|
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
|
|
|
|
Deprecated modules
|
2013-10-12 12:11:53 -04:00
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
::
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
|
|
|
|
Module name: posixfile
|
|
|
|
|
Rationale: Locking is better done by fcntl.lockf().
|
|
|
|
|
Date: Before 1-Oct-2000.
|
2007-05-20 19:59:49 -04:00
|
|
|
|
Documentation: Already documented as obsolete. Deprecation
|
|
|
|
|
warning added in Python 2.6.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
|
|
|
|
Module name: gopherlib
|
|
|
|
|
Rationale: The gopher protocol is not in active use anymore.
|
|
|
|
|
Date: 1-Oct-2000.
|
2007-05-16 18:46:19 -04:00
|
|
|
|
Documentation: Documented as deprecated since Python 2.5. Removed
|
|
|
|
|
in Python 2.6.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
|
|
|
|
Module name: rgbimgmodule
|
2003-11-19 12:12:46 -05:00
|
|
|
|
Rationale: In a 2001-04-24 c.l.py post, Jason Petrone mentions
|
2013-10-18 11:49:14 -04:00
|
|
|
|
that he occasionally uses it; no other references to
|
2003-11-19 12:12:46 -05:00
|
|
|
|
its use can be found as of 2003-11-19.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
Date: 1-Oct-2000
|
2007-05-20 03:13:46 -04:00
|
|
|
|
Documentation: Documented as deprecated since Python 2.5. Removed
|
|
|
|
|
in Python 2.6.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2002-04-10 18:09:55 -04:00
|
|
|
|
Module name: pre
|
2013-10-18 11:49:14 -04:00
|
|
|
|
Rationale: The underlying PCRE engine doesn't support Unicode, and
|
2002-04-10 18:09:55 -04:00
|
|
|
|
has been unmaintained since Python 1.5.2.
|
|
|
|
|
Date: 10-Apr-2002
|
2013-10-18 11:49:14 -04:00
|
|
|
|
Documentation: It was only mentioned as an implementation detail,
|
2002-04-10 18:09:55 -04:00
|
|
|
|
and never had a section of its own. This mention
|
|
|
|
|
has now been removed.
|
|
|
|
|
|
2002-04-11 16:48:55 -04:00
|
|
|
|
Module name: whrandom
|
|
|
|
|
Rationale: The module's default seed computation was
|
2002-04-11 16:52:00 -04:00
|
|
|
|
inherently insecure; the random module should be
|
2002-04-11 16:48:55 -04:00
|
|
|
|
used instead.
|
|
|
|
|
Date: 11-Apr-2002
|
|
|
|
|
Documentation: This module has been documented as obsolete since
|
|
|
|
|
Python 2.1, but listing in this PEP was neglected.
|
|
|
|
|
The deprecation warning will be added to the module
|
|
|
|
|
one year after Python 2.3 is released, and the
|
|
|
|
|
module will be removed one year after that.
|
|
|
|
|
|
2002-09-20 08:54:36 -04:00
|
|
|
|
Module name: rfc822
|
|
|
|
|
Rationale: Supplanted by Python 2.2's email package.
|
|
|
|
|
Date: 18-Mar-2002
|
2006-02-17 06:56:02 -05:00
|
|
|
|
Documentation: Documented as "deprecated since release 2.3" since
|
|
|
|
|
Python 2.2.2.
|
2002-09-20 08:54:36 -04:00
|
|
|
|
|
2002-09-25 18:09:30 -04:00
|
|
|
|
Module name: mimetools
|
2002-09-20 08:54:36 -04:00
|
|
|
|
Rationale: Supplanted by Python 2.2's email package.
|
|
|
|
|
Date: 18-Mar-2002
|
2006-02-17 06:56:02 -05:00
|
|
|
|
Documentation: Documented as "deprecated since release 2.3" since
|
|
|
|
|
Python 2.2.2.
|
2002-09-20 08:54:36 -04:00
|
|
|
|
|
2002-09-25 18:09:30 -04:00
|
|
|
|
Module name: MimeWriter
|
2002-09-20 08:54:36 -04:00
|
|
|
|
Rationale: Supplanted by Python 2.2's email package.
|
|
|
|
|
Date: 18-Mar-2002
|
2006-02-17 06:56:02 -05:00
|
|
|
|
Documentation: Documented as "deprecated since release 2.3" since
|
2007-05-30 16:48:17 -04:00
|
|
|
|
Python 2.2.2. Raises a DeprecationWarning as of
|
|
|
|
|
Python 2.6.
|
2002-09-20 08:54:36 -04:00
|
|
|
|
|
2002-09-25 18:09:30 -04:00
|
|
|
|
Module name: mimify
|
2002-09-20 08:54:36 -04:00
|
|
|
|
Rationale: Supplanted by Python 2.2's email package.
|
|
|
|
|
Date: 18-Mar-2002
|
2006-02-17 06:56:02 -05:00
|
|
|
|
Documentation: Documented as "deprecated since release 2.3" since
|
2007-05-30 17:49:50 -04:00
|
|
|
|
Python 2.2.2. Raises a DeprecationWarning as of
|
|
|
|
|
Python 2.6.
|
2002-09-20 08:54:36 -04:00
|
|
|
|
|
2003-04-24 09:13:33 -04:00
|
|
|
|
Module name: rotor
|
|
|
|
|
Rationale: Uses insecure algorithm.
|
2003-04-24 09:15:11 -04:00
|
|
|
|
Date: 24-Apr-2003
|
2006-02-17 06:56:02 -05:00
|
|
|
|
Documentation: The documentation has been removed from the library
|
|
|
|
|
reference in Python 2.4.
|
2003-04-24 09:13:33 -04:00
|
|
|
|
|
2004-08-10 09:27:32 -04:00
|
|
|
|
Module name: TERMIOS.py
|
|
|
|
|
Rationale: The constants in this file are now in the 'termios' module.
|
|
|
|
|
Date: 10-Aug-2004
|
|
|
|
|
Documentation: This module has been documented as obsolete since
|
|
|
|
|
Python 2.1, but listing in this PEP was neglected.
|
2006-02-17 06:56:02 -05:00
|
|
|
|
Removed from the library reference in Python 2.4.
|
2004-08-10 09:27:32 -04:00
|
|
|
|
|
|
|
|
|
Module name: statcache
|
|
|
|
|
Rationale: Using the cache can be fragile and error-prone;
|
|
|
|
|
applications should just use os.stat() directly.
|
|
|
|
|
Date: 10-Aug-2004
|
|
|
|
|
Documentation: This module has been documented as obsolete since
|
|
|
|
|
Python 2.2, but listing in this PEP was neglected.
|
2006-02-17 06:56:02 -05:00
|
|
|
|
Removed from the library reference in Python 2.5.
|
2004-08-10 09:27:32 -04:00
|
|
|
|
|
|
|
|
|
Module name: mpz
|
|
|
|
|
Rationale: Third-party packages provide similiar features
|
|
|
|
|
and wrap more of GMP's API.
|
|
|
|
|
Date: 10-Aug-2004
|
|
|
|
|
Documentation: This module has been documented as obsolete since
|
|
|
|
|
Python 2.2, but listing in this PEP was neglected.
|
2006-02-17 06:56:02 -05:00
|
|
|
|
Removed from the library reference in Python 2.4.
|
2004-08-10 09:27:32 -04:00
|
|
|
|
|
|
|
|
|
Module name: xreadlines
|
|
|
|
|
Rationale: Using 'for line in file', introduced in 2.3, is preferable.
|
|
|
|
|
Date: 10-Aug-2004
|
|
|
|
|
Documentation: This module has been documented as obsolete since
|
|
|
|
|
Python 2.3, but listing in this PEP was neglected.
|
2006-02-17 06:56:02 -05:00
|
|
|
|
Removed from the library reference in Python 2.4.
|
2004-08-10 09:27:32 -04:00
|
|
|
|
|
2006-02-21 14:22:02 -05:00
|
|
|
|
Module name: multifile
|
|
|
|
|
Rationale: Supplanted by the email package.
|
|
|
|
|
Date: 21-Feb-2006
|
|
|
|
|
Documentation: Documented as deprecated as of Python 2.5.
|
|
|
|
|
|
2007-01-12 19:29:27 -05:00
|
|
|
|
Module name: sets
|
|
|
|
|
Rationale: The built-in set/frozenset types, introduced in
|
|
|
|
|
Python 2.4, supplant the module.
|
|
|
|
|
Date: 12-Jan-2007
|
|
|
|
|
Documentation: Documented as deprecated as of Python 2.6.
|
|
|
|
|
|
2007-05-16 00:31:51 -04:00
|
|
|
|
Module name: buildtools
|
|
|
|
|
Rationale: Unknown.
|
|
|
|
|
Date: 15-May-2007
|
|
|
|
|
Documentation: Documented as deprecated as of Python 2.3, but
|
2007-05-31 15:41:41 -04:00
|
|
|
|
listing in this PEP was neglected. Raised a
|
|
|
|
|
DeprecationWarning as of Python 2.6.
|
2007-05-16 00:31:51 -04:00
|
|
|
|
|
|
|
|
|
Module name: cfmfile
|
|
|
|
|
Rationale: Unknown.
|
|
|
|
|
Date: 15-May-2007
|
|
|
|
|
Documentation: Documented as deprecated as of Python 2.4, but
|
2007-05-31 16:01:43 -04:00
|
|
|
|
listing in this PEP was neglected. A
|
|
|
|
|
DeprecationWarning was added in Python 2.6.
|
2007-05-16 00:31:51 -04:00
|
|
|
|
|
|
|
|
|
Module name: macfs
|
|
|
|
|
Rationale: Unknown.
|
|
|
|
|
Date: 15-May-2007
|
|
|
|
|
Documentation: Documented as deprecated as of Python 2.3, but
|
2007-05-20 19:18:12 -04:00
|
|
|
|
listing in this PEP was neglected. Removed in
|
|
|
|
|
Python 2.6.
|
2007-05-16 00:31:51 -04:00
|
|
|
|
|
|
|
|
|
Module name: md5
|
|
|
|
|
Rationale: Replaced by the 'hashlib' module.
|
|
|
|
|
Date: 15-May-2007
|
|
|
|
|
Documentation: Documented as deprecated as of Python 2.5, but
|
|
|
|
|
listing in this PEP was neglected.
|
2007-05-30 18:24:53 -04:00
|
|
|
|
DeprecationWarning raised as of Python 2.6.
|
2007-05-16 00:31:51 -04:00
|
|
|
|
|
|
|
|
|
Module name: sha
|
|
|
|
|
Rationale: Replaced by the 'hashlib' module.
|
|
|
|
|
Date: 15-May-2007
|
|
|
|
|
Documentation: Documented as deprecated as of Python 2.5, but
|
|
|
|
|
listing in this PEP was neglected.
|
2007-05-31 15:20:54 -04:00
|
|
|
|
DeprecationWarning added in Python 2.6.
|
2007-05-16 00:31:51 -04:00
|
|
|
|
|
2013-10-18 11:49:14 -04:00
|
|
|
|
Module name: plat-freebsd2/IN and plat-freebsd3/IN
|
2007-05-16 01:04:32 -04:00
|
|
|
|
Rationale: Platforms are obsolete (last released in 2000)
|
|
|
|
|
Removed from 2.6
|
|
|
|
|
Date: 15-May-2007
|
|
|
|
|
Documentation: None
|
|
|
|
|
|
2013-10-18 11:49:14 -04:00
|
|
|
|
Module name: plat-freebsd4/IN and possibly plat-freebsd5/IN
|
2007-05-16 01:04:32 -04:00
|
|
|
|
Rationale: Platforms are obsolete/unsupported
|
|
|
|
|
Date: 15-May-2007
|
|
|
|
|
Remove from 2.7
|
|
|
|
|
Documentation: None
|
|
|
|
|
|
2013-10-18 11:49:14 -04:00
|
|
|
|
Module name: formatter
|
|
|
|
|
Rationale: Lack of use in the community, no tests to keep
|
|
|
|
|
code working.
|
|
|
|
|
Documentation: Deprecated as of Python 3.4 by raising
|
|
|
|
|
PendingDeprecationWarning. Slated for removal in
|
|
|
|
|
Python 3.6.
|
|
|
|
|
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2009-01-01 07:49:14 -05:00
|
|
|
|
Deprecation of modules removed in Python 3.0
|
2013-10-12 12:11:53 -04:00
|
|
|
|
============================================
|
2009-01-01 07:49:14 -05:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
PEP 3108 lists all modules that have been removed from Python 3.0.
|
|
|
|
|
They all are documented as deprecated in Python 2.6, and raise a
|
|
|
|
|
DeprecationWarning if the -3 flag is activated.
|
2013-10-18 11:49:14 -04:00
|
|
|
|
|
2009-01-01 07:49:14 -05:00
|
|
|
|
|
2000-10-04 18:40:30 -04:00
|
|
|
|
Undeprecated modules
|
2013-10-12 12:11:53 -04:00
|
|
|
|
====================
|
|
|
|
|
|
|
|
|
|
None.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright
|
|
|
|
|
=========
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
This document has been placed in the public domain.
|
2000-10-04 18:40:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-12 12:11:53 -04:00
|
|
|
|
..
|
|
|
|
|
Local Variables:
|
|
|
|
|
mode: indented-text
|
|
|
|
|
indent-tabs-mode: nil
|
|
|
|
|
sentence-end-double-space: t
|
|
|
|
|
fill-column: 70
|
|
|
|
|
coding: utf-8
|
|
|
|
|
End:
|