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
{{ message }}
Repository navigation
type of class member can be a free type variable #1903
fromtypingimportTypeVarT=TypeVar('T')
classA:
def__init__(self, x: T) ->None:
self.x=xa=A(1)
reveal_type(a.x) # E: Revealed type is 'T`-1'
I guess we need to check that the types of class attributes don't contain free type variables. (Type variables that are bound by the class declaration, i.e. deriving from Generic[T], are okay of course.)
Activity
ilevkivskyi commentedon Nov 7, 2019
Tracking this is now moved to #6520