diff --git a/stdlib/@tests/stubtest_allowlists/py315.txt b/stdlib/@tests/stubtest_allowlists/py315.txt index 7354dac4dc90..e99551a48ae0 100644 --- a/stdlib/@tests/stubtest_allowlists/py315.txt +++ b/stdlib/@tests/stubtest_allowlists/py315.txt @@ -17,7 +17,6 @@ _struct.pack _struct.pack_into _thread.RLock.__exit__ _thread.lock.__exit__ -copy.deepcopy dataclasses.MISSING dataclasses._MISSING_TYPE dataclasses.field diff --git a/stdlib/copy.pyi b/stdlib/copy.pyi index 373899ea2635..925bed1aada2 100644 --- a/stdlib/copy.pyi +++ b/stdlib/copy.pyi @@ -14,10 +14,15 @@ class _SupportsReplace(Protocol[_RT_co]): # None in CPython but non-None in Jython PyStringMap: Any -# Note: memo and _nil are internal kwargs. -def deepcopy(x: _T, memo: dict[int, Any] | None = None, _nil: Any = []) -> _T: ... def copy(x: _T) -> _T: ... +if sys.version_info >= (3, 15): + def deepcopy(x: _T, memo: dict[int, Any] | None = None) -> _T: ... + +else: + # Note: memo and _nil are internal kwargs. + def deepcopy(x: _T, memo: dict[int, Any] | None = None, _nil: Any = []) -> _T: ... + if sys.version_info >= (3, 13): __all__ += ["replace"] # The types accepted by `**changes` match those of `obj.__replace__`.