@@ -2351,7 +2351,10 @@ def check_override(
2351
2351
# Use boolean variable to clarify code.
2352
2352
fail = False
2353
2353
op_method_wider_note = False
2354
- if not is_subtype (override , original , ignore_pos_arg_names = True ):
2354
+
2355
+ if not is_subtype (
2356
+ override , original , ignore_pos_arg_names = self .options .work_not_properly_function_names
2357
+ ):
2355
2358
fail = True
2356
2359
elif isinstance (override , Overloaded ) and self .is_forward_op_method (name ):
2357
2360
# Operator method overrides cannot extend the domain, as
@@ -2837,7 +2840,7 @@ class C(B, A[int]): ... # this is unsafe because...
2837
2840
call = find_member ("__call__" , first_type , first_type , is_operator = True )
2838
2841
if call and isinstance (second_type , FunctionLike ):
2839
2842
second_sig = self .bind_and_map_method (second , second_type , ctx , base2 )
2840
- ok = is_subtype (call , second_sig , ignore_pos_arg_names = True )
2843
+ ok = is_subtype (call , second_sig )
2841
2844
elif isinstance (first_type , FunctionLike ) and isinstance (second_type , FunctionLike ):
2842
2845
if first_type .is_type_obj () and second_type .is_type_obj ():
2843
2846
# For class objects only check the subtype relationship of the classes,
@@ -2850,7 +2853,7 @@ class C(B, A[int]): ... # this is unsafe because...
2850
2853
# First bind/map method types when necessary.
2851
2854
first_sig = self .bind_and_map_method (first , first_type , ctx , base1 )
2852
2855
second_sig = self .bind_and_map_method (second , second_type , ctx , base2 )
2853
- ok = is_subtype (first_sig , second_sig , ignore_pos_arg_names = True )
2856
+ ok = is_subtype (first_sig , second_sig )
2854
2857
elif first_type and second_type :
2855
2858
if isinstance (first .node , Var ):
2856
2859
first_type = expand_self_type (first .node , first_type , fill_typevars (ctx ))
@@ -7754,12 +7757,7 @@ def is_more_general_arg_prefix(t: FunctionLike, s: FunctionLike) -> bool:
7754
7757
7755
7758
def is_same_arg_prefix (t : CallableType , s : CallableType ) -> bool :
7756
7759
return is_callable_compatible (
7757
- t ,
7758
- s ,
7759
- is_compat = is_same_type ,
7760
- ignore_return = True ,
7761
- check_args_covariantly = True ,
7762
- ignore_pos_arg_names = True ,
7760
+ t , s , is_compat = is_same_type , ignore_return = True , check_args_covariantly = True
7763
7761
)
7764
7762
7765
7763
0 commit comments