@@ -4449,7 +4449,7 @@ def infer_variable_type(
44494449 # partial type which will be made more specific later. A partial type
44504450 # gets generated in assignment like 'x = []' where item type is not known.
44514451 if name .name != "_" and not self .infer_partial_type (name , lvalue , init_type ):
4452- self .msg .need_annotation_for_var (name , context , self .options . python_version )
4452+ self .msg .need_annotation_for_var (name , context , self .options )
44534453 self .set_inference_error_fallback_type (name , lvalue , init_type )
44544454 elif (
44554455 isinstance (lvalue , MemberExpr )
@@ -4459,7 +4459,7 @@ def infer_variable_type(
44594459 and not is_same_type (self .inferred_attribute_types [lvalue .def_var ], init_type )
44604460 ):
44614461 # Multiple, inconsistent types inferred for an attribute.
4462- self .msg .need_annotation_for_var (name , context , self .options . python_version )
4462+ self .msg .need_annotation_for_var (name , context , self .options )
44634463 name .type = AnyType (TypeOfAny .from_error )
44644464 else :
44654465 # Infer type of the target.
@@ -4656,9 +4656,7 @@ def check_simple_assignment(
46564656 rvalue , type_context = lvalue_type , always_allow_any = always_allow_any
46574657 )
46584658 if not is_valid_inferred_type (rvalue_type , self .options ) and inferred is not None :
4659- self .msg .need_annotation_for_var (
4660- inferred , context , self .options .python_version
4661- )
4659+ self .msg .need_annotation_for_var (inferred , context , self .options )
46624660 rvalue_type = rvalue_type .accept (SetNothingToAny ())
46634661
46644662 if (
@@ -7680,7 +7678,7 @@ def enter_partial_types(
76807678 var .type = NoneType ()
76817679 else :
76827680 if var not in self .partial_reported and not permissive :
7683- self .msg .need_annotation_for_var (var , context , self .options . python_version )
7681+ self .msg .need_annotation_for_var (var , context , self .options )
76847682 self .partial_reported .add (var )
76857683 if var .type :
76867684 fixed = fixup_partial_type (var .type )
@@ -7707,9 +7705,7 @@ def handle_partial_var_type(
77077705 if in_scope :
77087706 context = partial_types [node ]
77097707 if is_local or not self .options .allow_untyped_globals :
7710- self .msg .need_annotation_for_var (
7711- node , context , self .options .python_version
7712- )
7708+ self .msg .need_annotation_for_var (node , context , self .options )
77137709 self .partial_reported .add (node )
77147710 else :
77157711 # Defer the node -- we might get a better type in the outer scope
0 commit comments