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
As far as I understand this, the inconsistency is stemming from the fact that literals are joined by their fallback types, while Unions are simply merged together, and that mypy treats Literals with multiple values as a Union of literals for each value.
So my thoughts on fixing this would to join Literals in the same way that Unions are joined, but I'm not sure if this would cause problems elsewhere.
This is an issue I ran into working on #9097.
Code adapted from this test.
Literals with one value:
Literals with multiple values:
On
Python 3.7
andmypy 0.790
.The text was updated successfully, but these errors were encountered: