Skip to content
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

[3.12] gh-119698: fix a special case in symtable.Class.get_methods (GH-121802) #121910

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 17, 2024

(cherry picked from commit 6682d91)

Co-authored-by: Bénédikt Tran [email protected]

@picnixz
Copy link
Contributor

picnixz commented Jul 17, 2024

Oh:

    type x[genexpr = (x async for x in [])] = (x async for x in [])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?

Is it expected? did something change between 3.12 and 3.13 for this?

@JelleZijlstra
Copy link
Member

Oh yeah, I made comprehensions in annotation scopes a syntax error in 3.12, but then added support in 3.13.

@JelleZijlstra
Copy link
Member

And also, the tests were using TypeVar defaults, which only exist in 3.13. I removed the tests that rely on comprehensions within annotation scopes within classes, because that was a SyntaxError in 3.12.

@JelleZijlstra JelleZijlstra merged commit 3279a4f into python:3.12 Jul 17, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants