https://github.com/python/cpython/commit/1df9d6282ed654d37284e95f19497e7895f734ee commit: 1df9d6282ed654d37284e95f19497e7895f734ee branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: StanFromIreland <[email protected]> date: 2026-09-11T15:17:51Z summary:
[3.14] gh-124205: Align descriptions of classes in 'Warning Categories' (GH-157255) (#157326) (cherry picked from commit 2360bda599981745dbefb17162a7237372bde8be) Co-authored-by: Owen Carey <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> files: M Doc/library/warnings.rst diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index 18f3dd4a14583e..bb5604f6d2b786 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 is 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). | +----------------------------------+-----------------------------------------------+ _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
