Skip to content

Commit 5939fe4

Browse files
committed
update fallback
1 parent fe30d22 commit 5939fe4

File tree

2 files changed

+6
-23
lines changed

2 files changed

+6
-23
lines changed

Diff for: msgpack/_unpacker.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def unpackb(object packed, *, object object_hook=None, object list_hook=None,
210210
raise ValueError("Unpack failed: error = %d" % (ret,))
211211

212212

213-
cdef class Unpacker(object):
213+
cdef class Unpacker:
214214
"""Streaming unpacker.
215215
216216
Arguments:

Diff for: msgpack/fallback.py

+5-22
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ class Unpacker:
232232
def __init__(
233233
self,
234234
file_like=None,
235+
*,
235236
read_size=0,
236237
use_list=True,
237238
raw=False,
@@ -650,39 +651,21 @@ class Packer:
650651
The error handler for encoding unicode. (default: 'strict')
651652
DO NOT USE THIS!! This option is kept for very specific usage.
652653
653-
Example of streaming deserialize from file-like object::
654-
655-
unpacker = Unpacker(file_like)
656-
for o in unpacker:
657-
process(o)
658-
659-
Example of streaming deserialize from socket::
660-
661-
unpacker = Unpacker()
662-
while True:
663-
buf = sock.recv(1024**2)
664-
if not buf:
665-
break
666-
unpacker.feed(buf)
667-
for o in unpacker:
668-
process(o)
669-
670-
Raises ``ExtraData`` when *packed* contains extra bytes.
671-
Raises ``OutOfData`` when *packed* is incomplete.
672-
Raises ``FormatError`` when *packed* is not valid msgpack.
673-
Raises ``StackError`` when *packed* contains too nested.
674-
Other exceptions can be raised during unpacking.
654+
:param int buf_size:
655+
Internal buffer size. This option is used only for C implementation.
675656
"""
676657

677658
def __init__(
678659
self,
660+
*,
679661
default=None,
680662
use_single_float=False,
681663
autoreset=True,
682664
use_bin_type=True,
683665
strict_types=False,
684666
datetime=False,
685667
unicode_errors=None,
668+
buf_size=None,
686669
):
687670
self._strict_types = strict_types
688671
self._use_float = use_single_float

0 commit comments

Comments
 (0)