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
How about making an immutabledict class where the value is covariant?
Other immutable containers are all covariant (Union, Tuple Sequence etc).
Because the _K is by default not covariant, my type hints did not work when they should have.
This was uncovered here: python/mypy#15710
Note: the copy method must be removed if you do that per pylance or mypy
The text was updated successfully, but these errors were encountered:
to resolve variance issues (with add_or_replace: _V_V cannot be covariant), where _U is another unbound type variable. Since your mapping is immutable, why constraint users in creating another instances with different types?
How about making an immutabledict class where the value is covariant?
Other immutable containers are all covariant (Union, Tuple Sequence etc).
Because the _K is by default not covariant, my type hints did not work when they should have.
This was uncovered here: python/mypy#15710
Note: the copy method must be removed if you do that per pylance or mypy
The text was updated successfully, but these errors were encountered: