Skip to content

Commit aa1603b

Browse files
authored
PEP 765: specify when the SyntaxWarning will be emitted, and explain why (#4132)
1 parent ac1c66e commit aa1603b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

peps/pep-0765.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,16 @@ However, we specify here that a ``SyntaxError`` is permitted by
132132
the language spec, so that other Python implementations can choose
133133
to implement that.
134134

135+
The CPython implementation will emit the ``SyntaxWarning`` during
136+
``AST`` construction, to ensure that the warning will show up during
137+
static anlaysis and compilation, but not during execution of
138+
pre-compiled code. We expect that the warning will be seen by a
139+
project maintainer (when they run static analysis, or CI which
140+
does not have precompiled files). However, end users of a project
141+
will only see a warning if they skip precompilation at installation
142+
time, check installation time warnings, or run static analysis over
143+
their dependencies.
144+
135145
Backwards Compatibility
136146
=======================
137147

0 commit comments

Comments
 (0)