File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -3804,12 +3804,9 @@ def get_protocol_members(tp: type, /) -> frozenset[str]:
3804
3804
return frozenset (tp .__protocol_attrs__ )
3805
3805
3806
3806
3807
- _P = ParamSpec ("_P" )
3808
-
3809
-
3810
- def copy_func_params (
3811
- source_func : Callable [_P , Any ]
3812
- ) -> Callable [[Callable [..., T ]], Callable [_P , T ]]:
3807
+ def copy_func_params [** Param , RV ](
3808
+ source_func : Callable [Param , Any ]
3809
+ ) -> Callable [[Callable [..., RV ]], Callable [Param , RV ]]:
3813
3810
"""Cast the decorated function's call signature to the source_func's.
3814
3811
3815
3812
Use this decorator enhancing an upstream function while keeping its
@@ -3836,8 +3833,8 @@ def enhanced(
3836
3833
*source_func* changes.
3837
3834
"""
3838
3835
3839
- def return_func (func : Callable [..., T ]) -> Callable [_P , T ]:
3840
- return cast (Callable [_P , T ], func )
3836
+ def return_func (func : Callable [..., RV ]) -> Callable [Param , RV ]:
3837
+ return cast (Callable [Param , RV ], func )
3841
3838
3842
3839
return return_func
3843
3840
You can’t perform that action at this time.
0 commit comments