We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4520bd commit 58bb691Copy full SHA for 58bb691
1 file changed
stdlib/copy.pyi
@@ -1,15 +1,16 @@
1
import sys
2
-from collections.abc import Callable
3
from typing import Any, Protocol, TypeVar
4
-from typing_extensions import Self
+from typing_extensions import ParamSpec, Self
5
6
__all__ = ["Error", "copy", "deepcopy"]
7
8
_T = TypeVar("_T")
9
-_SR = TypeVar("_SR", bound=_SupportsReplace)
+_SR = TypeVar("_SR", bound=_SupportsReplace[Any])
+_P = ParamSpec("_P")
10
11
-class _SupportsReplace(Protocol):
12
- __replace__: Callable[..., Self]
+class _SupportsReplace(Protocol[_P]):
+ # In reality doesn't support args, but there's no other great way to express this.
13
+ def __replace__(self: Self, *args: _P.args, **kwargs: _P.kwargs) -> Self: ...
14
15
# None in CPython but non-None in Jython
16
PyStringMap: Any
0 commit comments