10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61d228b commit 66d3cc0Copy full SHA for 66d3cc0
mypy/suggestions.py
@@ -897,6 +897,8 @@ def refine_type(ti: Type, si: Type) -> Type:
897
if isinstance(t, UnionType):
898
return refine_union(t, s)
899
900
+ # TODO: Refining of builtins.tuple, Type?
901
+
902
return t
903
904
@@ -921,8 +923,8 @@ def refine_union(t: UnionType, s: ProperType) -> Type:
921
923
if not refined:
922
924
new_items.append(lhs)
925
- # We don't ever want to drop None while making these things and
- # make_simplified_union calls join which cases
926
+ # Turn strict optional on when simplifying the union since we
927
+ # don't want to drop Nones.
928
with strict_optional_set(True):
929
return make_simplified_union(new_items)
930
0 commit comments