-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
global x: int
is not tested
#108983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
sobolevn
added a commit
to sobolevn/cpython
that referenced
this issue
Sep 6, 2023
JelleZijlstra
pushed a commit
that referenced
this issue
Sep 6, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 6, 2023
…08984) (cherry picked from commit 1fb20d4) Co-authored-by: Nikita Sobolev <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 6, 2023
…08984) (cherry picked from commit 1fb20d4) Co-authored-by: Nikita Sobolev <[email protected]>
JelleZijlstra
pushed a commit
that referenced
this issue
Sep 6, 2023
#109001) gh-108983: Add more PEP 526 tests to `test_grammar` (GH-108984) (cherry picked from commit 1fb20d4) Co-authored-by: Nikita Sobolev <[email protected]>
Yhg1s
pushed a commit
that referenced
this issue
Sep 8, 2023
#109000) gh-108983: Add more PEP 526 tests to `test_grammar` (GH-108984) (cherry picked from commit 1fb20d4) Co-authored-by: Nikita Sobolev <[email protected]>
Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
While reading https://peps.python.org/pep-0526/#where-annotations-aren-t-allowed I've noticed that not all corner-cases are covered:
cpython/Lib/test/test_grammar.py
Lines 347 to 365 in 6f8411c
For example, explicit PEP's example:
Two problems:
global x: int
is not tested, onlynonlocal x: int
isx: int; nonlocal x
is not testedThere's also an interesting corner-case from the rejected ideas:
Since, we have this test
check_syntax_error(self, "def f: int")
, I assume that we also test rejected ideas here. So, let's add this one as well.I propose adding these three cases.
Linked PRs
test_grammar
#108984test_grammar
(GH-108984) #109000test_grammar
(GH-108984) #109001The text was updated successfully, but these errors were encountered: