mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-08 22:36:18 +08:00
cb97bb54c0
Closes #579.
39 lines
712 B
Python
39 lines
712 B
Python
# Stubs for pickle (Python 2)
|
|
|
|
from typing import Any, BinaryIO
|
|
|
|
|
|
HIGHEST_PROTOCOL = ... # type: int
|
|
|
|
|
|
def dump(obj: Any, file: BinaryIO, protocol: int = None) -> None: ...
|
|
def dumps(obj: Any, protocol: int = ...) -> bytes: ...
|
|
def load(file: BinaryIO) -> Any: ...
|
|
def loads(string: bytes) -> Any: ...
|
|
|
|
|
|
class PickleError(Exception):
|
|
pass
|
|
|
|
|
|
class PicklingError(PickleError):
|
|
pass
|
|
|
|
|
|
class UnpicklingError(PickleError):
|
|
pass
|
|
|
|
|
|
class Pickler:
|
|
def __init__(self, file: BinaryIO, protocol: int = None) -> None: ...
|
|
|
|
def dump(self, obj: Any) -> None: ...
|
|
|
|
def clear_memo(self) -> None: ...
|
|
|
|
|
|
class Unpickler:
|
|
def __init__(self, file: BinaryIO) -> None: ...
|
|
|
|
def load(self) -> Any: ...
|