mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-11-13 12:52:55 +08:00
Merge pull request #120 from mgeisler/pickle-py2
Complete pickle and cPickle stubs for Python 2
This commit is contained in:
commit
b7eedfa07c
2 files changed
+44
-5
No files matched your search
@@ -7,10 +7,19 @@ format_version = ... # type: str
|
||||
class Pickler:
|
||||
def __init__(self, file: IO[str], protocol: int = ...) -> None: ...
|
||||
|
||||
def dump(self, obj: Any) -> None: ...
|
||||
|
||||
def clear_memo(self) -> None: ...
|
||||
|
||||
|
||||
class Unpickler:
|
||||
def __init__(self, file: IO[str]) -> None: ...
|
||||
|
||||
def load(self) -> Any: ...
|
||||
|
||||
def noload(self) -> Any: ...
|
||||
|
||||
|
||||
def dump(obj: Any, file: IO[str], protocol: int = ...) -> None: ...
|
||||
def dumps(obj: Any, protocol: int = ...) -> str: ...
|
||||
def load(file: IO[str]) -> Any: ...
|
||||
|
||||
+35
-5
@@ -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: ...
|
||||
Reference in new issue
Block a user