From 3a428f05ae2452374baabfe4cf676153f59a3fc2 Mon Sep 17 00:00:00 2001 From: Owen Carey <37121709+owenthcarey@users.noreply.github.com> Date: Wed, 9 Sep 2026 23:50:00 -0700 Subject: [PATCH 1/2] gh-124205: Align warning category documentation --- Doc/library/warnings.rst | 43 +++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index d5f89102d5853bb..eb1ee764899ff7f 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -68,45 +68,48 @@ The following warnings category classes are currently defined: +----------------------------------+-----------------------------------------------+ | Class | Description | +==================================+===============================================+ -| :exc:`Warning` | This is the base class of all warning | -| | category classes. It is a subclass of | -| | :exc:`Exception`. | +| :exc:`Warning` | Base class for warning categories. It's a | +| | subclass of :exc:`Exception`. | +----------------------------------+-----------------------------------------------+ -| :exc:`UserWarning` | The default category for :func:`warn`. | +| :exc:`UserWarning` | Base class for warnings generated by user | +| | code. The default category for :func:`warn`. | +----------------------------------+-----------------------------------------------+ -| :exc:`DeprecationWarning` | Base category for warnings about deprecated | +| :exc:`DeprecationWarning` | Base class for warnings about deprecated | | | features when those warnings are intended for | | | other Python developers (ignored by default, | | | unless triggered by code in ``__main__``). | +----------------------------------+-----------------------------------------------+ -| :exc:`SyntaxWarning` | Base category for warnings about dubious | -| | syntactic features (typically emitted when | -| | compiling Python source code, and hence | -| | may not be suppressed by runtime filters) | +| :exc:`PendingDeprecationWarning` | Base class for warnings about features | +| | that will be deprecated in the future | +| | (ignored by default). | +----------------------------------+-----------------------------------------------+ -| :exc:`RuntimeWarning` | Base category for warnings about dubious | -| | runtime features. | +| :exc:`SyntaxWarning` | Base class for warnings about dubious syntax | +| | (typically emitted when compiling Python | +| | source code, and hence may not be suppressed | +| | by runtime filters). | +----------------------------------+-----------------------------------------------+ -| :exc:`FutureWarning` | Base category for warnings about deprecated | +| :exc:`RuntimeWarning` | Base class for warnings about dubious runtime | +| | behavior. | ++----------------------------------+-----------------------------------------------+ +| :exc:`FutureWarning` | Base class for warnings about deprecated | | | features when those warnings are intended for | | | end users of applications that are written in | | | Python. | +----------------------------------+-----------------------------------------------+ -| :exc:`PendingDeprecationWarning` | Base category for warnings about features | -| | that will be deprecated in the future | -| | (ignored by default). | -+----------------------------------+-----------------------------------------------+ -| :exc:`ImportWarning` | Base category for warnings triggered during | +| :exc:`ImportWarning` | Base class for warnings triggered during | | | the process of importing a module (ignored by | | | default). | +----------------------------------+-----------------------------------------------+ -| :exc:`UnicodeWarning` | Base category for warnings related to | +| :exc:`UnicodeWarning` | Base class for warnings related to | | | Unicode. | +----------------------------------+-----------------------------------------------+ -| :exc:`BytesWarning` | Base category for warnings related to | +| :exc:`EncodingWarning` | Base class for warnings related to encodings. | +| | See :ref:`io-encoding-warning` for details. | ++----------------------------------+-----------------------------------------------+ +| :exc:`BytesWarning` | Base class for warnings related to | | | :class:`bytes` and :class:`bytearray`. | +----------------------------------+-----------------------------------------------+ -| :exc:`ResourceWarning` | Base category for warnings related to | +| :exc:`ResourceWarning` | Base class for warnings related to | | | resource usage (ignored by default). | +----------------------------------+-----------------------------------------------+ From 72d4620f93f1d67c782b0d41be250aaf1224d10d Mon Sep 17 00:00:00 2001 From: Owen Carey <37121709+owenthcarey@users.noreply.github.com> Date: Thu, 10 Sep 2026 21:10:02 -0700 Subject: [PATCH 2/2] Update Doc/library/warnings.rst Co-authored-by: Stan Ulbrych --- Doc/library/warnings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index eb1ee764899ff7f..1e8acb0cb51c918 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -68,7 +68,7 @@ The following warnings category classes are currently defined: +----------------------------------+-----------------------------------------------+ | Class | Description | +==================================+===============================================+ -| :exc:`Warning` | Base class for warning categories. It's a | +| :exc:`Warning` | Base class for warning categories. It is a | | | subclass of :exc:`Exception`. | +----------------------------------+-----------------------------------------------+ | :exc:`UserWarning` | Base class for warnings generated by user |