Skip to content

Commit 176d263

Browse files
authored
bpo-36404: recommend DeprecationWarning over PendingDeprecationWarning (GH-12505)
1 parent 2a4ce43 commit 176d263

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Doc/library/exceptions.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,14 @@ The following exceptions are used as warning categories; see the
694694
Base class for warnings about features which will be deprecated in the
695695
future.
696696

697+
.. note::
698+
PendingDeprecationWarning was introduced as an "ignored by default"
699+
version of DeprecationWarning. But :exc:`DeprecationWarning` is also
700+
ignored by default since Python 2.7 and 3.2.
701+
There is not much difference between PendingDeprecationWarning and
702+
DeprecationWarning nowadays. DeprecationWarning is recommended
703+
in general.
704+
697705

698706
.. exception:: SyntaxWarning
699707

Doc/library/warnings.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ The following warnings category classes are currently defined:
109109
+----------------------------------+-----------------------------------------------+
110110

111111
.. versionchanged:: 3.7
112-
Previously :exc:`DeprecationWarning` and :exc:`FutureWarning` were
113-
distinguished based on whether a feature was being removed entirely or
114-
changing its behaviour. They are now distinguished based on their
115-
intended audience and the way they're handled by the default warnings
116-
filters.
112+
Previously :exc:`DeprecationWarning` and :exc:`FutureWarning` were
113+
distinguished based on whether a feature was being removed entirely or
114+
changing its behaviour. They are now distinguished based on their
115+
intended audience and the way they're handled by the default warnings
116+
filters.
117117

118118

119119
.. _warning-filter:

0 commit comments

Comments
 (0)