@@ -1477,23 +1477,18 @@ def bind_self_fast(method: F, original_type: Type | None = None) -> F:
1477
1477
items = [bind_self_fast (c , original_type ) for c in method .items ]
1478
1478
return cast (F , Overloaded (items ))
1479
1479
assert isinstance (method , CallableType )
1480
- func : CallableType = method
1481
- if not func .arg_types :
1480
+ if not method .arg_types :
1482
1481
# Invalid method, return something.
1483
1482
return method
1484
- if func .arg_kinds [0 ] in (ARG_STAR , ARG_STAR2 ):
1483
+ if method .arg_kinds [0 ] in (ARG_STAR , ARG_STAR2 ):
1485
1484
# See typeops.py for details.
1486
1485
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 :],
1494
1490
is_bound = True ,
1495
1491
)
1496
- return cast (F , res )
1497
1492
1498
1493
1499
1494
def has_operator (typ : Type , op_method : str , named_type : Callable [[str ], Instance ]) -> bool :
0 commit comments