Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit67d0c8e

Browse files
committed
Use PEP 695 syntax
1 parent9ee231c commit67d0c8e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

‎Lib/typing.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3804,12 +3804,9 @@ def get_protocol_members(tp: type, /) -> frozenset[str]:
38043804
returnfrozenset(tp.__protocol_attrs__)
38053805

38063806

3807-
_P=ParamSpec("_P")
3808-
3809-
3810-
defcopy_func_params(
3811-
source_func:Callable[_P,Any]
3812-
)->Callable[[Callable[...,T]],Callable[_P,T]]:
3807+
defcopy_func_params[**Param,RV](
3808+
source_func:Callable[Param,Any]
3809+
)->Callable[[Callable[...,RV]],Callable[Param,RV]]:
38133810
"""Cast the decorated function's call signature to the source_func's.
38143811
38153812
Use this decorator enhancing an upstream function while keeping its
@@ -3836,8 +3833,8 @@ def enhanced(
38363833
*source_func* changes.
38373834
"""
38383835

3839-
defreturn_func(func:Callable[...,T])->Callable[_P,T]:
3840-
returncast(Callable[_P,T],func)
3836+
defreturn_func(func:Callable[...,RV])->Callable[Param,RV]:
3837+
returncast(Callable[Param,RV],func)
38413838

38423839
returnreturn_func
38433840

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp