Skip to content

Commit

Permalink
TYPING: add stubs for _packer and _unpacker (pandas-dev#28135)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins authored and proost committed Dec 19, 2019
1 parent 188c945 commit 49cf2f2
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pandas/io/msgpack/_packer.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# flake8: noqa

class Packer:
def __cinit__(self): ...
def __init__(
self,
default=...,
encoding=...,
unicode_errors=...,
use_single_float=...,
autoreset: int = ...,
use_bin_type: int = ...,
): ...
def __dealloc__(self): ...
def _pack(self, o, nest_limit: int = ...) -> int: ...
def pack(self, obj): ...
def pack_ext_type(self, typecode, data): ...
def pack_array_header(self, size): ...
def pack_map_header(self, size): ...
def pack_map_pairs(self, pairs): ...
def reset(self) -> None: ...
def bytes(self): ...
59 changes: 59 additions & 0 deletions pandas/io/msgpack/_unpacker.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# flake8: noqa

def unpackb(
packed,
object_hook=...,
list_hook=...,
use_list=...,
encoding=...,
unicode_errors=...,
object_pairs_hook=...,
ext_hook=...,
max_str_len=...,
max_bin_len=...,
max_array_len=...,
max_map_len=...,
max_ext_len=...,
): ...
def unpack(
stream,
object_hook=...,
list_hook=...,
use_list=...,
encoding=...,
unicode_errors=...,
object_pairs_hook=...,
): ...

class Unpacker:
def __cinit__(self): ...
def __dealloc__(self): ...
def __init__(
self,
file_like=...,
read_size=...,
use_list=...,
object_hook=...,
object_pairs_hook=...,
list_hook=...,
encoding=...,
unicode_errors=...,
max_buffer_size: int = ...,
ext_hook=...,
max_str_len=...,
max_bin_len=...,
max_array_len=...,
max_map_len=...,
max_ext_len=...,
): ...
def feed(self, next_bytes): ...
def append_buffer(self, _buf, _buf_len): ...
def read_from_file(self): ...
def _unpack(self, execute, write_bytes, iter=...): ...
def read_bytes(self, nbytes): ...
def unpack(self, write_bytes=...): ...
def skip(self, write_bytes=...): ...
def read_array_header(self, write_bytes=...): ...
def read_map_header(self, write_bytes=...): ...
def __iter__(self): ...
def __next__(self): ...

0 comments on commit 49cf2f2

Please sign in to comment.