Skip to content

[3.7] bpo-36404: recommend DeprecationWarning over PendingDeprecationWarning (GH-12505) #12696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Doc/library/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,14 @@ The following exceptions are used as warning categories; see the
Base class for warnings about features which will be deprecated in the
future.

.. note::
PendingDeprecationWarning was introduced as an "ignored by default"
version of DeprecationWarning. But :exc:`DeprecationWarning` is also
ignored by default since Python 2.7 and 3.2.
There is not much difference between PendingDeprecationWarning and
DeprecationWarning nowadays. DeprecationWarning is recommended
in general.


.. exception:: SyntaxWarning

Expand Down
10 changes: 5 additions & 5 deletions Doc/library/warnings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ The following warnings category classes are currently defined:
+----------------------------------+-----------------------------------------------+

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


.. _warning-filter:
Expand Down