File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 11import sys
22from typing import Any , Protocol , TypeVar
3- from typing_extensions import Self
3+ from typing_extensions import ParamSpec , Self
44
5- __all__ = ["Error" , "copy" , "deepcopy" , "replace" ]
5+ __all__ = ["Error" , "copy" , "deepcopy" ]
66
77_T = TypeVar ("_T" )
8- _SR = TypeVar ("_SR" , bound = _SupportsReplace )
8+ _SR = TypeVar ("_SR" , bound = _SupportsReplace [Any ])
9+ _P = ParamSpec ("_P" )
910
10- class _SupportsReplace (Protocol ):
11+ class _SupportsReplace (Protocol [ _P ] ):
1112 # In reality doesn't support args, but there's no other great way to express this.
12- def __replace__ (self , * args : Any , ** kwargs : Any ) -> Self : ...
13+ def __replace__ (self : Self , * args : _P . args , ** kwargs : _P . kwargs ) -> Self : ...
1314
1415# None in CPython but non-None in Jython
1516PyStringMap : Any
@@ -20,7 +21,6 @@ def copy(x: _T) -> _T: ...
2021
2122if sys .version_info >= (3 , 13 ):
2223 def replace (obj : _SR , / , ** changes : Any ) -> _SR : ...
23- __all__ += ["replace" ]
2424
2525class Error (Exception ): ...
2626
You can’t perform that action at this time.
0 commit comments