Skip to content

Support enums in unions per PEP 484 #1803

Closed
@gvanrossum

Description

@gvanrossum

See this PR for PEP 484: python/typing#240

Because we know that Enum classes cannot be further subclassed, picking apart a value that could be a specific enum or some other type by comparing to all possible values of the enum should be enough to conclude that in the "else" clause the value cannot be an instance of that enum any more, so it must be the other type (examples in the linked PEP section).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions