Skip to content

[red-knot] understand type[A | B] where A and B are both classes #14703

@Glyphack

Description

@Glyphack

(part of #14172)
type[A | B] Is equivalent to an enum of type[A] | type[B].

There are not a lot of edge cases looking at the tests here: https://github.com/python/typing/blob/main/conformance/tests/specialtypes_type.py#L50

Metadata

Metadata

Assignees

Labels

tyMulti-file analysis & type inference

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions