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 7f3d7f8 commit 5a08ce1Copy full SHA for 5a08ce1
mypy/checker.py
@@ -5889,9 +5889,13 @@ def find_isinstance_check_helper(
5889
# Also note that a care must be taken to unwrap this back at read places
5890
# where we use this to narrow down declared type.
5891
if node.callee.type_guard is not None:
5892
+ if isinstance(get_proper_type(node.callee.type_guard), UninhabitedType):
5893
+ return None, {}
5894
return {expr: TypeGuardedType(node.callee.type_guard)}, {}
5895
else:
5896
assert node.callee.type_is is not None
5897
+ if isinstance(get_proper_type(node.callee.type_is), UninhabitedType):
5898
5899
return conditional_types_to_typemaps(
5900
expr,
5901
*self.conditional_types_with_intersection(
0 commit comments