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
[case testTypingSelfCallableClassVar]
from typing import Self, ClassVar, Callable
class C:
f: ClassVar[Callable[[Self], Self]]
class D(C): ...
reveal_type(D().f()) # N: Revealed type is "__main__.D"
Note, according to conventions, callable that appears directly in ClassVar should act as a method, not as an instance attribute with a callable type, i.e. in this very specific case callable needs to be made generic.