Closed
Description
We recently upgraded the mypy requirement to mypy v1.0. One of the new capabilities of mypy 1.0 is that it can now type check the Self
type. I propose we use Self
for self type checking in Pandas instead if as we currently do, using TypeVar
s.
One issue with type checking using Self
, is that Self
was added only in python 3.11, while Pandas supports Python >= 3.8. However, Self
has been added to typing_extensions
, so if we add type_extensions
as a Pandas dependency for Python <3.11, we can use Self
for type checking purposes in Pandas.