8000 Do not annotate variables as type guards · python/mypy@3f068f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f068f5

Browse files
committed
Do not annotate variables as type guards
1 parent 40dfd7b commit 3f068f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4102,7 +4102,7 @@ def find_isinstance_check_helper(self, node: Expression) -> Tuple[TypeMap, TypeM
41024102
self.fail("Type guard requires positional argument", node)
41034103
return {}, {}
41044104
if literal(expr) == LITERAL_TYPE:
4105-
return {expr: TypeGuardType(node.callee.type_guard)}, {}
4105+
return {expr: node.callee.type_guard}, {}
41064106
elif isinstance(node, ComparisonExpr):
41074107
# Step 1: Obtain the types of each operand and whether or not we can
41084108
# narrow their types. (For example, we shouldn't try narrowing the

0 commit comments

Comments
 (0)
0