@@ -1477,23 +1477,18 @@ def bind_self_fast(method: F, original_type: Type | None = None) -> F:
14771477 items = [bind_self_fast (c , original_type ) for c in method .items ]
14781478 return cast (F , Overloaded (items ))
14791479 assert isinstance (method , CallableType )
1480- func : CallableType = method
1481- if not func .arg_types :
1480+ if not method .arg_types :
14821481 # Invalid method, return something.
14831482 return method
1484- if func .arg_kinds [0 ] in (ARG_STAR , ARG_STAR2 ):
1483+ if method .arg_kinds [0 ] in (ARG_STAR , ARG_STAR2 ):
14851484 # See typeops.py for details.
14861485 return method
1487- original_type = get_proper_type (original_type )
1488- if isinstance (original_type , CallableType ) and original_type .is_type_obj ():
1489- original_type = TypeType .make_normalized (original_type .ret_type )
1490- res = func .copy_modified (
1491- arg_types = func .arg_types [1 :],
1492- arg_kinds = func .arg_kinds [1 :],
1493- arg_names = func .arg_names [1 :],
1486+ return method .copy_modified (
1487+ arg_types = method .arg_types [1 :],
1488+ arg_kinds = method .arg_kinds [1 :],
1489+ arg_names = method .arg_names [1 :],
14941490 is_bound = True ,
14951491 )
1496- return cast (F , res )
14971492
14981493
14991494def has_operator (typ : Type , op_method : str , named_type : Callable [[str ], Instance ]) -> bool :
0 commit comments