]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-123858: Improve Doc: SyntaxWarning is emitted during bytecode generation (gh-122844)
authorHang <bebound@gmail.com>
Fri, 29 Aug 2025 13:29:59 +0000 (21:29 +0800)
committerGitHub <noreply@github.com>
Fri, 29 Aug 2025 13:29:59 +0000 (23:29 +1000)
---------

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Doc/library/exceptions.rst
Doc/library/warnings.rst

index a73cc2e8a2dd3e55a5d78272e1ea789e9de30592..89ebb69d931c9df8eae5d53acd752b8f46863f25 100644 (file)
@@ -897,6 +897,9 @@ The following exceptions are used as warning categories; see the
 
    Base class for warnings about dubious syntax.
 
+   This warning is typically emitted when compiling Python source code, and usually won't be reported
+   when running already compiled code.
+
 
 .. exception:: RuntimeWarning
 
index 05e061cc6977785956ca38f477233d28f857cba0..b6392450a1722f0df84ca588c99c365fd4d5e709 100644 (file)
@@ -80,7 +80,9 @@ The following warnings category classes are currently defined:
 |                                  | unless triggered by code in ``__main__``).    |
 +----------------------------------+-----------------------------------------------+
 | :exc:`SyntaxWarning`             | Base category for warnings about dubious      |
-|                                  | syntactic features.                           |
+|                                  | syntactic features (typically emitted when    |
+|                                  | compiling Python source code, and hence       |
+|                                  | may not be suppressed by runtime filters)     |
 +----------------------------------+-----------------------------------------------+
 | :exc:`RuntimeWarning`            | Base category for warnings about dubious      |
 |                                  | runtime features.                             |