Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,9 @@ typing_extensions\.Annotated # Undocumented implementation details
# (Remove once 3.10.17 becomes available for all platforms)
(email._header_value_parser.get_encoded_word)?
(email._header_value_parser.make_quoted_pairs)?

# These methods have no default implementation for Python < 3.13.
_pickle.Pickler.persistent_id
_pickle.Unpickler.persistent_load
pickle.Pickler.persistent_id
pickle.Unpickler.persistent_load
6 changes: 6 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,9 @@ typing_extensions\.Annotated # Undocumented implementation details
# (Remove once 3.11.12 becomes available for all platforms)
(email._header_value_parser.get_encoded_word)?
(email._header_value_parser.make_quoted_pairs)?

# These methods have no default implementation for Python < 3.13.
_pickle.Pickler.persistent_id
_pickle.Unpickler.persistent_load
pickle.Pickler.persistent_id
pickle.Unpickler.persistent_load
6 changes: 6 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,9 @@ sunau.Au_write.initfp
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
typing_extensions\.Annotated # Undocumented implementation details

# These methods have no default implementation for Python < 3.13.
_pickle.Pickler.persistent_id
_pickle.Unpickler.persistent_load
pickle.Pickler.persistent_id
pickle.Unpickler.persistent_load
6 changes: 6 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py39.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,9 @@ typing_extensions\.Annotated # Undocumented implementation details
# Incompatible changes introduced in Python 3.9.22
# (Remove once 3.9.22 becomes available for all platforms)
(email._header_value_parser.get_encoded_word)?

# These methods have no default implementation for Python < 3.13.
_pickle.Pickler.persistent_id
_pickle.Unpickler.persistent_load
pickle.Pickler.persistent_id
pickle.Unpickler.persistent_load
15 changes: 6 additions & 9 deletions stdlib/_pickle.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from _typeshed import ReadableBuffer, SupportsWrite
from collections.abc import Callable, Iterable, Iterator, Mapping
from pickle import PickleBuffer as PickleBuffer
Expand Down Expand Up @@ -75,10 +74,9 @@ class Pickler:
def memo(self, value: PicklerMemoProxy | dict[int, tuple[int, Any]]) -> None: ...
def dump(self, obj: Any, /) -> None: ...
def clear_memo(self) -> None: ...
if sys.version_info >= (3, 13):
def persistent_id(self, obj: Any, /) -> Any: ...
else:
persistent_id: Callable[[Any], Any]

# this method has no default implementation for Python < 3.13
def persistent_id(self, obj: Any, /) -> Any: ...

@type_check_only
class UnpicklerMemoProxy:
Expand All @@ -101,7 +99,6 @@ class Unpickler:
def memo(self, value: UnpicklerMemoProxy | dict[int, tuple[int, Any]]) -> None: ...
def load(self) -> Any: ...
def find_class(self, module_name: str, global_name: str, /) -> Any: ...
if sys.version_info >= (3, 13):
def persistent_load(self, pid: Any, /) -> Any: ...
else:
persistent_load: Callable[[Any], Any]

# this method has no default implementation for Python < 3.13
def persistent_load(self, pid: Any, /) -> Any: ...