I'm trying to add type annotations to an existing package, and clearly I'm missing something important. I have an abstract superclass, and subclasses. The superclass should be generic, whereas the subclasses should be for a specific type. Here's a simple example if that I see, and what I'd like to see:
from typing import Generic, TypeVar
T = TypeVar("T")
class A(Generic[T]):
def method(self, arg: T):
...
class B(A[int]):
def method(self, arg):
reveal_locals()
Expected (or at least hoped for):
GenericTest.py:11: note: Revealed local types are:
GenericTest.py:11: note: arg: int
GenericTest.py:11: note: self: Any
Got:
GenericTest.py:11: note: Revealed local types are:
GenericTest.py:11: note: arg: Any
GenericTest.py:11: note: self: Any