@@ -1971,6 +1971,9 @@ def check_method_override_for_base_with_name(
19711971 original_class_or_static ,
19721972 override_class_or_static ,
19731973 context ,
1974+ ignore_pos_arg_names = (
1975+ not context .is_explicit_override if isinstance (context , FuncDef ) else True
1976+ ),
19741977 )
19751978 elif is_equivalent (original_type , typ ):
19761979 # Assume invariance for a non-callable attribute here. Note
@@ -2058,6 +2061,7 @@ def check_override(
20582061 original_class_or_static : bool ,
20592062 override_class_or_static : bool ,
20602063 node : Context ,
2064+ ignore_pos_arg_names : bool ,
20612065 ) -> None :
20622066 """Check a method override with given signatures.
20632067
@@ -2071,7 +2075,7 @@ def check_override(
20712075 # Use boolean variable to clarify code.
20722076 fail = False
20732077 op_method_wider_note = False
2074- if not is_subtype (override , original , ignore_pos_arg_names = True ):
2078+ if not is_subtype (override , original , ignore_pos_arg_names = ignore_pos_arg_names ):
20752079 fail = True
20762080 elif isinstance (override , Overloaded ) and self .is_forward_op_method (name ):
20772081 # Operator method overrides cannot extend the domain, as
0 commit comments