Skip to content

Commit 2360bda

Browse files
gh-124205: Align descriptions of classes in 'Warning Categories' (#157255)
Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent b6e8088 commit 2360bda

1 file changed

Lines changed: 23 additions & 20 deletions

File tree

Doc/library/warnings.rst

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,45 +68,48 @@ The following warnings category classes are currently defined:
6868
+----------------------------------+-----------------------------------------------+
6969
| Class | Description |
7070
+==================================+===============================================+
71-
| :exc:`Warning` | This is the base class of all warning |
72-
| | category classes. It is a subclass of |
73-
| | :exc:`Exception`. |
71+
| :exc:`Warning` | Base class for warning categories. It is a |
72+
| | subclass of :exc:`Exception`. |
7473
+----------------------------------+-----------------------------------------------+
75-
| :exc:`UserWarning` | The default category for :func:`warn`. |
74+
| :exc:`UserWarning` | Base class for warnings generated by user |
75+
| | code. The default category for :func:`warn`. |
7676
+----------------------------------+-----------------------------------------------+
77-
| :exc:`DeprecationWarning` | Base category for warnings about deprecated |
77+
| :exc:`DeprecationWarning` | Base class for warnings about deprecated |
7878
| | features when those warnings are intended for |
7979
| | other Python developers (ignored by default, |
8080
| | unless triggered by code in ``__main__``). |
8181
+----------------------------------+-----------------------------------------------+
82-
| :exc:`SyntaxWarning` | Base category for warnings about dubious |
83-
| | syntactic features (typically emitted when |
84-
| | compiling Python source code, and hence |
85-
| | may not be suppressed by runtime filters) |
82+
| :exc:`PendingDeprecationWarning` | Base class for warnings about features |
83+
| | that will be deprecated in the future |
84+
| | (ignored by default). |
8685
+----------------------------------+-----------------------------------------------+
87-
| :exc:`RuntimeWarning` | Base category for warnings about dubious |
88-
| | runtime features. |
86+
| :exc:`SyntaxWarning` | Base class for warnings about dubious syntax |
87+
| | (typically emitted when compiling Python |
88+
| | source code, and hence may not be suppressed |
89+
| | by runtime filters). |
8990
+----------------------------------+-----------------------------------------------+
90-
| :exc:`FutureWarning` | Base category for warnings about deprecated |
91+
| :exc:`RuntimeWarning` | Base class for warnings about dubious runtime |
92+
| | behavior. |
93+
+----------------------------------+-----------------------------------------------+
94+
| :exc:`FutureWarning` | Base class for warnings about deprecated |
9195
| | features when those warnings are intended for |
9296
| | end users of applications that are written in |
9397
| | Python. |
9498
+----------------------------------+-----------------------------------------------+
95-
| :exc:`PendingDeprecationWarning` | Base category for warnings about features |
96-
| | that will be deprecated in the future |
97-
| | (ignored by default). |
98-
+----------------------------------+-----------------------------------------------+
99-
| :exc:`ImportWarning` | Base category for warnings triggered during |
99+
| :exc:`ImportWarning` | Base class for warnings triggered during |
100100
| | the process of importing a module (ignored by |
101101
| | default). |
102102
+----------------------------------+-----------------------------------------------+
103-
| :exc:`UnicodeWarning` | Base category for warnings related to |
103+
| :exc:`UnicodeWarning` | Base class for warnings related to |
104104
| | Unicode. |
105105
+----------------------------------+-----------------------------------------------+
106-
| :exc:`BytesWarning` | Base category for warnings related to |
106+
| :exc:`EncodingWarning` | Base class for warnings related to encodings. |
107+
| | See :ref:`io-encoding-warning` for details. |
108+
+----------------------------------+-----------------------------------------------+
109+
| :exc:`BytesWarning` | Base class for warnings related to |
107110
| | :class:`bytes` and :class:`bytearray`. |
108111
+----------------------------------+-----------------------------------------------+
109-
| :exc:`ResourceWarning` | Base category for warnings related to |
112+
| :exc:`ResourceWarning` | Base class for warnings related to |
110113
| | resource usage (ignored by default). |
111114
+----------------------------------+-----------------------------------------------+
112115

0 commit comments

Comments
 (0)