Skip to content

TYP: use Self for type checking #51233

Closed
@topper-123

Description

@topper-123

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 TypeVars.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Typingtype annotations, mypy/pyright type checking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions