Open
Description
Feature
I would like to have TypeVars in my stubs that do not appear in my source code, but stubtest
will flag the typevar as not present at runtime. Therefore, I decided to put them all in if TYPE_CHECKING
statements at the beginning of stubs, like:
from typing import TYPE_CHECKING, TypeVar, Generic
if TYPE_CHECKING:
T = TypeVar("T")
class SomeClass(Generic[T]):
...
Pitch
It is not ideal to create a regex for the TypeVar variable names in an allowlist, and it would be much easier to add other type aliases that aren't in the source code but are in stub files.