From b62ef7a9384277d95bbfa20e28f679ffa98c188b Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Thu, 21 Nov 2024 00:29:46 +0000 Subject: [PATCH 1/3] PEP 765: specify when the SyntaxWarning will be emitted, and explain why --- peps/pep-0765.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/peps/pep-0765.rst b/peps/pep-0765.rst index fc44f4bc60b..08ef4d5c590 100644 --- a/peps/pep-0765.rst +++ b/peps/pep-0765.rst @@ -132,6 +132,16 @@ However, we specify here that a ``SyntaxError`` is permitted by the language spec, so that other Python implementations can choose to implement that. +The CPython implementation will emit the `SyntaxWarning` during +`AST` construction, to ensure that the warning will show up during +static anlaysis and compilation, but not during execution of +pre-compiled code. We expect that the warning will be seen by +project maintainer (when they run static analysis, or CI which +does not have precompiled files). However, end users of a project +will only see a warning if they skip precompilation at installation +time, check installation time warnings, or run static analysis over +their dependencies. + Backwards Compatibility ======================= From 97cd815e0f02e2656c38b4dbd5a1e502af8a0d3b Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Thu, 21 Nov 2024 00:59:26 +0000 Subject: [PATCH 2/3] typos --- peps/pep-0765.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/peps/pep-0765.rst b/peps/pep-0765.rst index 08ef4d5c590..1202563b850 100644 --- a/peps/pep-0765.rst +++ b/peps/pep-0765.rst @@ -132,8 +132,8 @@ However, we specify here that a ``SyntaxError`` is permitted by the language spec, so that other Python implementations can choose to implement that. -The CPython implementation will emit the `SyntaxWarning` during -`AST` construction, to ensure that the warning will show up during +The CPython implementation will emit the ``SyntaxWarning`` during +``AST`` construction, to ensure that the warning will show up during static anlaysis and compilation, but not during execution of pre-compiled code. We expect that the warning will be seen by project maintainer (when they run static analysis, or CI which From 4e77a0c5ba5859531439606a045825b0538e82aa Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:54:23 +0000 Subject: [PATCH 3/3] Update pep-0765.rst Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- peps/pep-0765.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peps/pep-0765.rst b/peps/pep-0765.rst index 1202563b850..9d06d251434 100644 --- a/peps/pep-0765.rst +++ b/peps/pep-0765.rst @@ -135,7 +135,7 @@ to implement that. The CPython implementation will emit the ``SyntaxWarning`` during ``AST`` construction, to ensure that the warning will show up during static anlaysis and compilation, but not during execution of -pre-compiled code. We expect that the warning will be seen by +pre-compiled code. We expect that the warning will be seen by a project maintainer (when they run static analysis, or CI which does not have precompiled files). However, end users of a project will only see a warning if they skip precompilation at installation