Skip to content

Self-referencing types #457

@refi64

Description

@refi64

There are some types that need to reference themselves. For instance:

class X():
    def some_func() -> X:
        ...

However, this is NOT valid Python 3 (X has not yet been fully declared at this point). Mypy should have a way for types to self-reference themselves (maybe a ThisType type?).

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