From 2398f0f88a28e403068e962c1eec5ff21632b61a Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Sat, 23 Mar 2019 11:04:13 +0900 Subject: [PATCH 1/4] deprecate PendingDeprecationWarning in doc --- Doc/library/exceptions.rst | 8 ++++++++ Doc/library/warnings.rst | 19 +++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index 57ed2914581621..867e55e973e01d 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. + .. deprecated:: 3.8 + PendingDeprecationWarning was introduced as "ignored by default" version + of DeprecationWarning. But :exc:`DeprecationWarning` is ignored by + default since Python 2.7 and 3.2. There is no enough reason to use + PendingDeprecationWarning instead of DeprecationWarning for nowadays. + There is no plan to actual removal, but new use of + PendingDeprecationWarning is not recommended. + .. exception:: SyntaxWarning diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index b04bd79e4bbdc2..38c5e824ed6676 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -92,7 +92,7 @@ The following warnings category classes are currently defined: +----------------------------------+-----------------------------------------------+ | :exc:`PendingDeprecationWarning` | Base category for warnings about features | | | that will be deprecated in the future | -| | (ignored by default). | +| | (ignored by default, and deprecated). | +----------------------------------+-----------------------------------------------+ | :exc:`ImportWarning` | Base category for warnings triggered during | | | the process of importing a module (ignored by | @@ -109,11 +109,18 @@ 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. + +.. versionchanged:: 3.8 + :exc:`PendingDeprecationWarning` is now deprecated. It was introduced + as "ignored by default" version of :exc:`DeprecationWarning`. But + :exc:`DeprecationWarning` is ignored by default since Python 2.7 and 3.2. + There is no enough reason to use :exc:`PendingDeprecationWarning` instead + of :exc:`DeprecationWarning` for nowadays. .. _warning-filter: From f1d64dafa7f8ab8c771df32ba152168102302405 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Sat, 23 Mar 2019 20:54:46 +0900 Subject: [PATCH 2/4] fix based on PR comments --- Doc/library/exceptions.rst | 10 +++++----- Doc/library/warnings.rst | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index 867e55e973e01d..f3fd0001ae7197 100644 --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -695,11 +695,11 @@ The following exceptions are used as warning categories; see the future. .. deprecated:: 3.8 - PendingDeprecationWarning was introduced as "ignored by default" version - of DeprecationWarning. But :exc:`DeprecationWarning` is ignored by - default since Python 2.7 and 3.2. There is no enough reason to use - PendingDeprecationWarning instead of DeprecationWarning for nowadays. - There is no plan to actual removal, but new use of + PendingDeprecationWarning was introduced as an "ignored by default" + version of DeprecationWarning. But :exc:`DeprecationWarning` is ignored + by default since Python 2.7 and 3.2. There is no reason to use + PendingDeprecationWarning instead of DeprecationWarning nowadays. + There is no plan for actual removal, but new use of PendingDeprecationWarning is not recommended. diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index 38c5e824ed6676..6e3e3de81bb219 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -117,10 +117,10 @@ The following warnings category classes are currently defined: .. versionchanged:: 3.8 :exc:`PendingDeprecationWarning` is now deprecated. It was introduced - as "ignored by default" version of :exc:`DeprecationWarning`. But + as an "ignored by default" version of :exc:`DeprecationWarning`. But :exc:`DeprecationWarning` is ignored by default since Python 2.7 and 3.2. - There is no enough reason to use :exc:`PendingDeprecationWarning` instead - of :exc:`DeprecationWarning` for nowadays. + There is no reason to use :exc:`PendingDeprecationWarning` instead + of :exc:`DeprecationWarning` nowadays. .. _warning-filter: From 77910b860da5bf98913c6d30c5dbe8ac745f51bb Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sat, 30 Mar 2019 20:20:29 +0900 Subject: [PATCH 3/4] deprecated -> note --- Doc/library/exceptions.rst | 10 +++++----- Doc/library/warnings.rst | 9 +-------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index f3fd0001ae7197..14d637d910ecfa 100644 --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -694,13 +694,13 @@ The following exceptions are used as warning categories; see the Base class for warnings about features which will be deprecated in the future. - .. deprecated:: 3.8 + .. note:: PendingDeprecationWarning was introduced as an "ignored by default" version of DeprecationWarning. But :exc:`DeprecationWarning` is ignored - by default since Python 2.7 and 3.2. There is no reason to use - PendingDeprecationWarning instead of DeprecationWarning nowadays. - There is no plan for actual removal, but new use of - PendingDeprecationWarning is not recommended. + 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 6e3e3de81bb219..d121f320d6a3eb 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -92,7 +92,7 @@ The following warnings category classes are currently defined: +----------------------------------+-----------------------------------------------+ | :exc:`PendingDeprecationWarning` | Base category for warnings about features | | | that will be deprecated in the future | -| | (ignored by default, and deprecated). | +| | (ignored by default). | +----------------------------------+-----------------------------------------------+ | :exc:`ImportWarning` | Base category for warnings triggered during | | | the process of importing a module (ignored by | @@ -115,13 +115,6 @@ The following warnings category classes are currently defined: intended audience and the way they're handled by the default warnings filters. -.. versionchanged:: 3.8 - :exc:`PendingDeprecationWarning` is now deprecated. It was introduced - as an "ignored by default" version of :exc:`DeprecationWarning`. But - :exc:`DeprecationWarning` is ignored by default since Python 2.7 and 3.2. - There is no reason to use :exc:`PendingDeprecationWarning` instead - of :exc:`DeprecationWarning` nowadays. - .. _warning-filter: From ee8cabb8bf243477c74a7bf6ccc665798d9ac989 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Mon, 1 Apr 2019 17:24:09 +0900 Subject: [PATCH 4/4] Update exceptions.rst --- Doc/library/exceptions.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index 14d637d910ecfa..250938003c078c 100644 --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -696,8 +696,8 @@ The following exceptions are used as warning categories; see the .. note:: PendingDeprecationWarning was introduced as an "ignored by default" - version of DeprecationWarning. But :exc:`DeprecationWarning` is ignored - by default since Python 2.7 and 3.2. + 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.