Skip to content

Commit ac8b5c5

Browse files
authored
Update PEP 387 based on discussions (#1432)
1 parent 7a94c3e commit ac8b5c5

File tree

1 file changed

+32
-17
lines changed

1 file changed

+32
-17
lines changed

pep-0387.txt

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ Version: $Revision$
44
Last-Modified: $Date$
55
Author: Benjamin Peterson <[email protected]>
66
BDFL-Delegate: Brett Cannon (on behalf of the steering council)
7+
Discussions-To: https://discuss.python.org/t/pep-387-backwards-compatibilty-policy/
78
Status: Draft
89
Type: Process
910
Content-Type: text/x-rst
1011
Created: 18-Jun-2009
11-
Post-History: 19-Jun-2009
12+
Post-History: 19-Jun-2009, 12-Jun-2020
1213

1314

1415
Abstract
@@ -33,9 +34,9 @@ Backwards Compatibility Rules
3334
This policy applies to all public APIs. These include:
3435

3536
- Syntax and behavior of these constructs as defined by the reference
36-
manual
37+
manual.
3738

38-
- The C-API
39+
- The C-API.
3940

4041
- Function, class, module, attribute, and method names and types.
4142

@@ -48,31 +49,44 @@ This policy applies to all public APIs. These include:
4849
- Behavior of classes with regards to subclasses: the conditions under
4950
which overridden methods are called.
5051

52+
- Documented exceptions and the semantics which lead to their raising.
53+
54+
- Exceptions commonly raised in EAFP scenarios.
55+
5156
Others are explicitly not part of the public API. They can change or
5257
be removed at any time in any way. These include:
5358

54-
- Function, class, module, attribute, method, and C-API names and types that
55-
are prefixed by "_" (except special names). The contents of these
56-
are also not subject to the policy.
59+
- Function, class, module, attribute, method, and C-API names and
60+
types that are prefixed by "_" (except special names).
61+
62+
- Anything documented publicly as being private.
63+
64+
- Imported modules (unless explicitly documented as part of the public
65+
API; e.g. importing the ``bacon`` module in the ``spam`` does not
66+
automatically mean ``spam.bacon`` is part of hte public API unless
67+
it is documented as such).
5768

5869
- Inheritance patterns of internal classes.
5970

60-
- Test suites. (Anything in the Lib/test directory or test
71+
- Test suites. (Anything in the ``Lib/test`` directory or test
6172
subdirectories of packages.)
6273

63-
This is the basic policy for backwards compatibility:
74+
75+
Basic policy for backwards compatibility
76+
----------------------------------------
6477

6578
* In general, incompatibilities should have a large benefit to
6679
breakage ratio, and the incompatibility should be easy to resolve in
6780
affected code. For example, adding an stdlib module with the same
68-
name as a third party package is not acceptable. Adding a method or
69-
attribute that conflicts with 3rd party code through inheritance,
70-
however, is likely reasonable.
81+
name as a third party package is generally not acceptable. Adding
82+
a method or attribute that conflicts with 3rd party code through
83+
inheritance, however, is likely reasonable.
7184

7285
* Unless it is going through the deprecation process below, the
73-
behavior of an API *must* not change between any two consecutive
74-
releases. Python's yearly release process (:pep:`602`) means that
75-
the deprecation period must last at least two years.
86+
behavior of an API *must* not change in an incompatible fashion
87+
between any two consecutive releases. Python's yearly release
88+
process (:pep:`602`) means that the deprecation period must last at
89+
least two years.
7690

7791
* Similarly a feature cannot be removed without notice between any two
7892
consecutive releases.
@@ -88,8 +102,8 @@ This is the basic policy for backwards compatibility:
88102
Making Incompatible Changes
89103
===========================
90104

91-
Making an incompatible change is a gradual process performed over several
92-
releases:
105+
Making an incompatible change is a gradual process performed over
106+
several releases:
93107

94108
1. Discuss the change. Depending on the degree of incompatibility,
95109
this could be on the bug tracker, python-dev, python-list, or the
@@ -114,7 +128,8 @@ releases:
114128
reconsider.
115129

116130
5. The behavior change or feature removal may now be made default or
117-
permanent in the N+3 release. Remove the old version and warning.
131+
permanent having reached the declared version. Remove the old
132+
version and warning.
118133

119134

120135
References

0 commit comments

Comments
 (0)