Skip to content

Use typing.Self consistently #316

@disinvite

Description

@disinvite

When you need to reference the type of a class inside of the class declaration, your options are to quote the class name:

class Hello:
    @classmethod
    def create(cls) -> "Hello":
        pass

or use typing.Self, introduced in Python 3.11.

We still support Python 3.10 so we need to import Self from typing_extensions instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupFix the leftovers of a major migrationtopic-pythonCode quality of reccmp itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions