Skip to content

Commit b404c60

Browse files
committed
revert
1 parent 23f4d66 commit b404c60

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stdlib/copy.pyi

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import sys
22
from 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
1516
PyStringMap: Any
@@ -20,7 +21,6 @@ def copy(x: _T) -> _T: ...
2021

2122
if sys.version_info >= (3, 13):
2223
def replace(obj: _SR, /, **changes: Any) -> _SR: ...
23-
__all__ += ["replace"]
2424

2525
class Error(Exception): ...
2626

0 commit comments

Comments
 (0)