@@ -4,11 +4,12 @@ Version: $Revision$
4
4
Last-Modified: $Date$
5
5
Author: Benjamin Peterson <
[email protected] >
6
6
BDFL-Delegate: Brett Cannon (on behalf of the steering council)
7
+ Discussions-To: https://discuss.python.org/t/pep-387-backwards-compatibilty-policy/
7
8
Status: Draft
8
9
Type: Process
9
10
Content-Type: text/x-rst
10
11
Created: 18-Jun-2009
11
- Post-History: 19-Jun-2009
12
+ Post-History: 19-Jun-2009, 12-Jun-2020
12
13
13
14
14
15
Abstract
@@ -33,9 +34,9 @@ Backwards Compatibility Rules
33
34
This policy applies to all public APIs. These include:
34
35
35
36
- Syntax and behavior of these constructs as defined by the reference
36
- manual
37
+ manual.
37
38
38
- - The C-API
39
+ - The C-API.
39
40
40
41
- Function, class, module, attribute, and method names and types.
41
42
@@ -48,31 +49,44 @@ This policy applies to all public APIs. These include:
48
49
- Behavior of classes with regards to subclasses: the conditions under
49
50
which overridden methods are called.
50
51
52
+ - Documented exceptions and the semantics which lead to their raising.
53
+
54
+ - Exceptions commonly raised in EAFP scenarios.
55
+
51
56
Others are explicitly not part of the public API. They can change or
52
57
be removed at any time in any way. These include:
53
58
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).
57
68
58
69
- Inheritance patterns of internal classes.
59
70
60
- - Test suites. (Anything in the Lib/test directory or test
71
+ - Test suites. (Anything in the `` Lib/test`` directory or test
61
72
subdirectories of packages.)
62
73
63
- This is the basic policy for backwards compatibility:
74
+
75
+ Basic policy for backwards compatibility
76
+ ----------------------------------------
64
77
65
78
* In general, incompatibilities should have a large benefit to
66
79
breakage ratio, and the incompatibility should be easy to resolve in
67
80
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.
71
84
72
85
* 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.
76
90
77
91
* Similarly a feature cannot be removed without notice between any two
78
92
consecutive releases.
@@ -88,8 +102,8 @@ This is the basic policy for backwards compatibility:
88
102
Making Incompatible Changes
89
103
===========================
90
104
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:
93
107
94
108
1. Discuss the change. Depending on the degree of incompatibility,
95
109
this could be on the bug tracker, python-dev, python-list, or the
@@ -114,7 +128,8 @@ releases:
114
128
reconsider.
115
129
116
130
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.
118
133
119
134
120
135
References
0 commit comments