Skip to content

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
Member

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
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