You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> classB: pass
...
>>> class X[T]([(x :=3) for _ inrange(2)] and B): print(x)
...
3
This is because a walrus in a comprehension assigns to the immediately enclosing scope, which is now the type parameter scope. I don't think this causes any concrete problem right now, but I don't like it because I'd like to preserve the invariant that type parameters are the only names that can be defined in PEP 695 scopes.
Example:
This is because a walrus in a comprehension assigns to the immediately enclosing scope, which is now the type parameter scope. I don't think this causes any concrete problem right now, but I don't like it because I'd like to preserve the invariant that type parameters are the only names that can be defined in PEP 695 scopes.
Linked PRs
The text was updated successfully, but these errors were encountered: