mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-09 18:09:17 +08:00
[pickle] Fix _Pickle.reducer_override annotation (#13545)
This commit is contained in:
+4
-1
@@ -208,7 +208,6 @@ class _Pickler:
|
||||
dispatch_table: Mapping[type, Callable[[Any], _ReducedType]]
|
||||
bin: bool # undocumented
|
||||
dispatch: ClassVar[dict[type, Callable[[Unpickler, Any], None]]] # undocumented, _Pickler only
|
||||
reducer_override: Callable[[Any], Any]
|
||||
def __init__(
|
||||
self,
|
||||
file: SupportsWrite[bytes],
|
||||
@@ -220,6 +219,10 @@ class _Pickler:
|
||||
def dump(self, obj: Any) -> None: ...
|
||||
def clear_memo(self) -> None: ...
|
||||
def persistent_id(self, obj: Any) -> Any: ...
|
||||
# The following method is not defined on _Pickler, but can be defined on
|
||||
# sub-classes. Should return `NotImplemented` if pickling the supplied
|
||||
# object is not supported and returns the same types as `__reduce__()`.
|
||||
def reducer_override(self, obj: object, /) -> _ReducedType: ...
|
||||
|
||||
class _Unpickler:
|
||||
dispatch: ClassVar[dict[int, Callable[[Unpickler], None]]] # undocumented, _Unpickler only
|
||||
|
||||
Reference in New Issue
Block a user