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
invalid_def_raw and invalid_class_def_raw rules do not account for type parameters #110938
Labels
3.12
bugs and security fixes
3.13
new features, bugs and security fixes
topic-parser
topic-typing
type-bug
An unexpected behavior, bug, or error
Comments
cc @pablogsal @lysnikolaou and @JelleZijlstra as author of implementation of PEP 695 |
Will make a pr today |
pablogsal
added a commit
to pablogsal/cpython
that referenced
this issue
Oct 17, 2023
…s and classes with generic type parameters Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal
added a commit
that referenced
this issue
Oct 17, 2023
…classes with generic type parameters (#110973)
Sorry for being late with the review, but there are several test cases that are missing from @pablogsal's PR. I've opened a new one to address this case:
>>> class A[T]
File "<stdin>", line 1
class A[T]
^
SyntaxError: invalid syntax
>>> class A[T]()
File "<stdin>", line 1
class A[T]()
^
SyntaxError: invalid syntax
>>> class A[T]
File "<stdin>", line 1
class A[T]
^
SyntaxError: expected ':'
>>> class A[T]()
File "<stdin>", line 1
class A[T]()
^
SyntaxError: expected ':' It is fixed, but not tested 👍 |
sobolevn
added a commit
to sobolevn/cpython
that referenced
this issue
Oct 17, 2023
This was referenced Oct 17, 2023
JelleZijlstra
pushed a commit
to JelleZijlstra/cpython
that referenced
this issue
Oct 17, 2023
…unctions and classes with generic type parameters (pythonGH-110973) (cherry picked from commit 24e4ec7) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
hauntsaninja
pushed a commit
that referenced
this issue
Oct 18, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 18, 2023
…onGH-110986) (cherry picked from commit 220bcc9) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
JelleZijlstra
pushed a commit
that referenced
this issue
Oct 18, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.12
bugs and security fixes
3.13
new features, bugs and security fixes
topic-parser
topic-typing
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
The rules which are affected are here:
cpython/Grammar/python.gram
Line 1371 in 6a4528d
Typically I believe they should read
to allow proper error reporting if the definition uses type parameters.
CPython versions tested on:
3.12
Operating systems tested on:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: