Skip to content

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

Merged
JelleZijlstra merged 2 commits intopython:3.12from
miss-islington:backport-6682d91-3.12
Jul 17, 2024
Merged

[3.12] gh-119698: fix a special case in symtable.Class.get_methods (GH-121802)#121910
JelleZijlstra merged 2 commits intopython:3.12from
miss-islington:backport-6682d91-3.12

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 10796600+picnixz@users.noreply.github.com

…ythonGH-121802)

(cherry picked from commit 6682d91)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@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
@miss-islington miss-islington deleted the backport-6682d91-3.12 branch January 2, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants