
Do you have an example of such a breaking case that's not using a walrus?
Yes, it breaks for generics declared within a class body if they reference other symbols declared within that class body. Here are examples of a generic method, generic class, and generic type alias declared within a class body. ```python class A: # This succeeds because it doesn't reference any other symbols # within the class A scope. class B[T]: ... # This fails because B cannot be accessed in the expression "B[T]" # if evaluated within an inner scope. def method[T](self, b: B[T], c: T): ... # This fails because B cannot be accessed in the expression "B[T]" # if evaluated within an inner scope. class C[T](B[T]): ... # This fails because C cannot be accessed in the expression "C[T]" # if evaluated within an inner scope. type MyAlias[T] = C[T] ``` The problem here is that class scopes don't support cell variables, so there's no way for a variable declared within a class body to be part of an inner scope's closure. All such variables are accessible only within the class scope. For this reason, I don't think it will work to introduce a new scope.