我是 Python 注释的新手(类型提示)。我注意到文件中的许多类定义pyi都继承了Generic[_T], 和_T = TypeVar('_T').
pyi
Generic[_T]
_T = TypeVar('_T')
我很困惑,_T这里是什么意思?
_T
from typing import Generic, TypeVar _T = TypeVar('_T') class Base(Generic[_T]): pass
python annotations type-hinting pyi
annotations ×1
pyi ×1
python ×1
type-hinting ×1