pickle: sync Python 2.7 stubs with Python 3 version

The Python 3 version was added in 94467be.
This commit is contained in:
Martin Geisler
2016-03-15 18:47:41 +01:00
parent 6dcb32c7d9
commit 6fec910c66

View File

@@ -1,8 +1,38 @@
# Stubs for pickle (Python 2)
from typing import Any, IO
from typing import Any, BinaryIO
def dump(obj: Any, file: IO[str], protocol: int = ...) -> None: ...
def dumps(obj: Any, protocol: int = ...) -> str: ...
def load(file: IO[str]) -> Any: ...
def loads(str: str) -> Any: ...
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: ...