From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 5 Apr 2019 09:07:21 +0000 (-0700) Subject: bpo-36404: recommend DeprecationWarning over PendingDeprecationWarning (GH-12505) X-Git-Tag: v3.7.4rc1~262 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=86fbe0287dd774022fd2b6c2dcbfbb5573a0b874;p=thirdparty%2FPython%2Fcpython.git bpo-36404: recommend DeprecationWarning over PendingDeprecationWarning (GH-12505) (cherry picked from commit 176d26364bb67801fa522f52f20cbe44420d6942) Co-authored-by: Inada Naoki --- diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index 57ed29145816..250938003c07 100644 --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -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 diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index b04bd79e4bbd..d121f320d6a3 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -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: