Skip to content

Submission for SC consideration: PEP 673 -- Self Type #95

@pradeep90

Description

@pradeep90

Please consider PEP 673 for inclusion in Python 3.11. This is primarily of interest to users of static type checkers. It provides a simple and intuitive way to annotate methods that accept or return an instance of their class.

The PEP has been discussed at length in typing sig and on the draft doc. We have also notified python-dev.

There are reference implementations of the type checking part in Pyright and Mypy. There is also an implementation of the Self special form in typing_extensions.py.

CC: @Gobot1234 @JelleZijlstra

https://www.python.org/dev/peps/pep-0673/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions