Skip to content

Simplify Protocol import #39

@tekktrik

Description

@tekktrik

The typical try/except typing block has an inner one that attempts to import Protocol from the typing module, but imports it from typing_extensions as a fallback. The typing_extensions module already attempts to import typing.Protocol anyways.

Therefore, this can be changed to a simple from typing_extensions import Protocol within the typing try/except block.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions