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 5910e0d commit a72ba7aCopy full SHA for a72ba7a
mypy/checker.py
@@ -145,6 +145,7 @@
145
WithStmt,
146
YieldExpr,
147
get_func_def,
148
+ is_class_var,
149
is_final_node,
150
)
151
from mypy.operators import flip_ops, int_op_to_method, neg_ops
@@ -3271,12 +3272,7 @@ def check_redundant_annotation(self, s: AssignmentStmt) -> None:
3271
3272
and is_same_type(s.type, self.expr_checker.accept(s.rvalue))
3273
):
3274
# skip ClassVar
- if any(
3275
- isinstance(lvalue, NameExpr)
3276
- and isinstance(lvalue.node, Var)
3277
- and lvalue.node.is_classvar
3278
- for lvalue in s.lvalues
3279
- ):
+ if any(isinstance(lvalue, NameExpr) and is_class_var(lvalue) for lvalue in s.lvalues):
3280
return
3281
3282
# skip dataclass and NamedTuple
0 commit comments