From a7ab344c5c730c59c6867a90fd8c955acf9aec3f Mon Sep 17 00:00:00 2001 From: Maxwell Muoto <41130755+max-muoto@users.noreply.github.com> Date: Mon, 22 Jul 2024 20:37:05 -0500 Subject: [PATCH 1/2] Remove ParamSpec for SupportsReplace --- stdlib/copy.pyi | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stdlib/copy.pyi b/stdlib/copy.pyi index 020ce6c31b58..9dc013090326 100644 --- a/stdlib/copy.pyi +++ b/stdlib/copy.pyi @@ -1,16 +1,15 @@ import sys from typing import Any, Protocol, TypeVar -from typing_extensions import ParamSpec, Self +from typing_extensions import Self __all__ = ["Error", "copy", "deepcopy"] _T = TypeVar("_T") _SR = TypeVar("_SR", bound=_SupportsReplace[Any]) -_P = ParamSpec("_P") -class _SupportsReplace(Protocol[_P]): +class _SupportsReplace(Protocol): # In reality doesn't support args, but there's no other great way to express this. - def __replace__(self, *args: _P.args, **kwargs: _P.kwargs) -> Self: ... + def __replace__(self, *args: Any, **kwargs: Any) -> Self: ... # None in CPython but non-None in Jython PyStringMap: Any From b1914ff26b41959a1345e0fa83982acfa226bdb8 Mon Sep 17 00:00:00 2001 From: Max Muoto Date: Mon, 22 Jul 2024 23:31:59 -0500 Subject: [PATCH 2/2] Update copy.pyi --- stdlib/copy.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/copy.pyi b/stdlib/copy.pyi index 9dc013090326..2cceec6a2250 100644 --- a/stdlib/copy.pyi +++ b/stdlib/copy.pyi @@ -5,7 +5,7 @@ from typing_extensions import Self __all__ = ["Error", "copy", "deepcopy"] _T = TypeVar("_T") -_SR = TypeVar("_SR", bound=_SupportsReplace[Any]) +_SR = TypeVar("_SR", bound=_SupportsReplace) class _SupportsReplace(Protocol): # In reality doesn't support args, but there's no other great way to express this.