2002-06-06 15:25:31 -04:00
|
|
|
|
PEP: 291
|
|
|
|
|
Title: Backward Compatibility for Standard Library
|
|
|
|
|
Version: $Revision$
|
|
|
|
|
Last-Modified: $Date$
|
|
|
|
|
Author: neal@metaslash.com (Neal Norwitz)
|
|
|
|
|
Status: Active
|
|
|
|
|
Type: Informational
|
|
|
|
|
Created: 06-Jun-2002
|
|
|
|
|
Post-History:
|
|
|
|
|
Python-Version: 2.3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Abstract
|
|
|
|
|
|
|
|
|
|
This PEP describes the packages and modules in the standard
|
|
|
|
|
library which should remain backward compatible with previous
|
|
|
|
|
versions of Python.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rationale
|
|
|
|
|
|
|
|
|
|
Authors have various reasons why packages and modules should
|
|
|
|
|
continue to work with previous versions of Python. In order to
|
|
|
|
|
maintain backward compatibility for these modules while moving the
|
|
|
|
|
rest of the standard library forward, it is necessary to know
|
|
|
|
|
which modules can be modified and which should use old and
|
|
|
|
|
possibly deprecated features.
|
|
|
|
|
|
|
|
|
|
Generally, authors should attempt to keep changes backward
|
|
|
|
|
compatible with the previous released version of Python in order
|
|
|
|
|
to make bug fixes easier to backport.
|
|
|
|
|
|
2002-11-15 17:53:27 -05:00
|
|
|
|
In addition to a package or module being listed in this PEP,
|
|
|
|
|
authors must add a comment at the top of each file documenting
|
|
|
|
|
the compatibility requirement.
|
|
|
|
|
|
2002-06-06 15:25:31 -04:00
|
|
|
|
|
|
|
|
|
Features to Avoid
|
|
|
|
|
|
|
|
|
|
The following list contains common features to avoid in order
|
|
|
|
|
to maintain backward compatibility with each version of Python.
|
|
|
|
|
This list is not complete! It is only meant as a general guide.
|
|
|
|
|
|
2002-11-29 20:50:39 -05:00
|
|
|
|
Note that the features below were implemented in the version
|
|
|
|
|
following the one listed. For example, features listed next to
|
|
|
|
|
1.5.2 were implemented in 2.0.
|
2002-06-06 15:25:31 -04:00
|
|
|
|
|
2002-11-29 20:50:39 -05:00
|
|
|
|
Version Features to Avoid
|
|
|
|
|
------- -----------------
|
2002-06-06 15:25:31 -04:00
|
|
|
|
1.5.2 string methods, Unicode, list comprehensions,
|
|
|
|
|
augmented assignment (eg, +=), zip(), import x as y,
|
|
|
|
|
dict.setdefault(), print >> f, calling f(*args, **kw),
|
2002-11-29 20:50:39 -05:00
|
|
|
|
plus all features below
|
2002-06-06 15:25:31 -04:00
|
|
|
|
|
|
|
|
|
2.0 nested scopes, rich comparisons, function attributes,
|
2002-11-29 20:50:39 -05:00
|
|
|
|
plus all features below
|
2002-06-06 15:25:31 -04:00
|
|
|
|
|
|
|
|
|
2.1 use of object or new-style classes, iterators,
|
|
|
|
|
using generators, nested scopes, or //
|
|
|
|
|
without from __future__ import ... statement,
|
2002-11-29 20:50:39 -05:00
|
|
|
|
plus all features below
|
2002-06-06 15:25:31 -04:00
|
|
|
|
|
|
|
|
|
2.2 bool, True, False, basestring, enumerate(), {}.pop(),
|
2002-11-29 20:50:39 -05:00
|
|
|
|
PendingDeprecationWarning, Universal Newlines
|
2002-06-06 15:25:31 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Backward Compatible Packages, Modules, and Tools
|
|
|
|
|
|
|
|
|
|
Package/Module Maintainer(s) Python Version
|
|
|
|
|
-------------- ------------- --------------
|
2003-01-10 14:13:46 -05:00
|
|
|
|
bsddb Barry Warsaw 2.1
|
2002-06-06 15:25:31 -04:00
|
|
|
|
compiler Jeremy Hylton 2.1
|
|
|
|
|
distutils Andrew Kuchling 1.5.2
|
|
|
|
|
email Barry Warsaw 2.1
|
2002-11-15 17:53:27 -05:00
|
|
|
|
logging Vinay Sajip 1.5.2
|
2003-07-02 17:07:42 -04:00
|
|
|
|
sre Fredrik Lundh 2.1
|
2002-06-06 15:25:31 -04:00
|
|
|
|
xml (PyXML) Martin v. Loewis 2.0
|
|
|
|
|
xmlrpclib Fredrik Lundh 1.5.2
|
2003-07-18 11:32:46 -04:00
|
|
|
|
modulefinder Thomas Heller, Just van Rossum
|
|
|
|
|
2.2
|
2002-06-06 15:25:31 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tool Maintainer(s) Python Version
|
|
|
|
|
---- ------------- --------------
|
2002-11-15 17:53:27 -05:00
|
|
|
|
None
|
2002-06-06 15:25:31 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright
|
|
|
|
|
|
|
|
|
|
This document has been placed in the public domain.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
mode: indented-text
|
|
|
|
|
indent-tabs-mode: nil
|
|
|
|
|
sentence-end-double-space: t
|
|
|
|
|
fill-column: 70
|
|
|
|
|
End:
|