@@ -2580,7 +2580,7 @@ def analyze_member_lvalue(self, lval: MemberExpr, explicit_type: bool, is_final:
25802580 lval .accept (self )
25812581 if self .is_self_member_ref (lval ):
25822582 assert self .type , "Self member outside a class"
2583- cur_node = self .type .names .get (lval .name , None )
2583+ cur_node = self .type .names .get (lval .name )
25842584 node = self .type .get (lval .name )
25852585 if cur_node and is_final :
25862586 # Overrides will be checked in type checker.
@@ -2591,11 +2591,12 @@ def analyze_member_lvalue(self, lval: MemberExpr, explicit_type: bool, is_final:
25912591 cur_node .node .is_inferred and explicit_type ):
25922592 self .attribute_already_defined (lval .name , lval , cur_node )
25932593 # If the attribute of self is not defined in superclasses, create a new Var, ...
2594- if ((node is None or isinstance (node .node , Var ) and node .node .is_abstract_var ) or
2594+ if (node is None
2595+ or (isinstance (node .node , Var ) and node .node .is_abstract_var )
25952596 # ... also an explicit declaration on self also creates a new Var.
25962597 # Note that `explicit_type` might has been erased for bare `Final`,
25972598 # so we also check if `is_final` is passed.
2598- (cur_node is None and (explicit_type or is_final ))):
2599+ or (cur_node is None and (explicit_type or is_final ))):
25992600 if self .type .is_protocol and node is None :
26002601 self .fail ("Protocol members cannot be defined via assignment to self" , lval )
26012602 else :
0 commit comments