You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for singleton types in unions with Enum (#7693)
This PR adds supports for singleton types in unions using `Enum`s as described
in [PEP 484][0] (without using `Final`).
As suggested by @Michael0x2a in [the corresponding issue][1], adding another
case to the `is_singleton_type` and `coerce_to_literal`functions allows mypy
to recognize an `Enum` with 1 value as a singleton type.
Fixes#7279
[0]: https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions
[1]: #7279 (comment)
0 commit comments