Skip to content

Support PEP 604 - union types as X | Y #9610

Closed
@cdce8p

Description

@cdce8p

Feature
Add support for PEP 604 to mypy. Since it has been officially accepted, should mypy add support for X | Y now? The syntax won't change anymore, is backwards compatible and there is an existing implementation https://github.com/pprados/mypy/tree/PEP604

Pitch
Adding this now would allow projects to already take advantage of the new syntax for type checking when using
from __future__ import annotations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions