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
The main example is a little hairy. The cause here is that the typeshed stub for get is def get(self, k: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ....
If we changed the definition to the more obvious def get(self, k: _KT, default: _T) -> Union[_VT_co, _T]: ..., then I think this would work. That change did get made, but we had to revert it because it caused issues python/typeshed#2817.
I think our conclusion was that #6613 would allow doing that. So I am going to close this issue in favor of that one but add a note to it. Thanks!
correctly complains that the type of
a
has changed:However
does not complain that
a
type could be changed tostr
due to the default value in the get call.Additionally, I'm not sure if the code below should complain since the dictionary may potentially return any type
thanks!
The text was updated successfully, but these errors were encountered: