Skip to content

Commit 4276558

Browse files
author
Guido van Rossum
committed
Simplify condition, per code review
1 parent 52fab47 commit 4276558

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/semanal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1826,7 +1826,7 @@ def analyze_lvalue(self, lval: Lvalue, nested: bool = False,
18261826
lval.kind = LDEF
18271827
lval.fullname = lval.name
18281828
self.add_local(v, lval)
1829-
if isinstance(lval, NameExpr) and lval.name == '_' and self.is_func_scope():
1829+
if lval.name == '_':
18301830
# Special case for assignment to local named '_': always infer 'Any'.
18311831
typ = AnyType(TypeOfAny.special_form)
18321832
self.store_declared_types(lval, typ)

0 commit comments

Comments
 (0)