Skip to content

Commit 15a46eb

Browse files
committed
use_list=1 is default
1 parent 1c6ef90 commit 15a46eb

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

msgpack/_msgpack.pyx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ cdef extern from "unpack.h":
219219

220220

221221
def unpackb(object packed, object object_hook=None, object list_hook=None,
222-
use_list=None, encoding=None, unicode_errors="strict",
222+
bint use_list=1, encoding=None, unicode_errors="strict",
223223
):
224224
"""Unpack packed_bytes to object. Returns an unpacked object.
225225
@@ -250,11 +250,7 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
250250
err = PyBytes_AsString(berrors)
251251

252252
template_init(&ctx)
253-
if use_list is None:
254-
warnings.warn("Set use_list explicitly.", category=DeprecationWarning, stacklevel=1)
255-
ctx.user.use_list = 0
256-
else:
257-
ctx.user.use_list = use_list
253+
ctx.user.use_list = use_list
258254
ctx.user.object_hook = ctx.user.list_hook = NULL
259255
ctx.user.encoding = <const_char_ptr>enc
260256
ctx.user.unicode_errors = <const_char_ptr>err
@@ -277,15 +273,12 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
277273

278274

279275
def unpack(object stream, object object_hook=None, object list_hook=None,
280-
use_list=None, encoding=None, unicode_errors="strict",
276+
bint use_list=1, encoding=None, unicode_errors="strict",
281277
):
282278
"""Unpack an object from `stream`.
283279
284280
Raises `ValueError` when `stream` has extra bytes.
285281
"""
286-
if use_list is None:
287-
warnings.warn("Set use_list explicitly.", category=DeprecationWarning, stacklevel=1)
288-
use_list = 0
289282
return unpackb(stream.read(), use_list=use_list,
290283
object_hook=object_hook, list_hook=list_hook,
291284
encoding=encoding, unicode_errors=unicode_errors,
@@ -356,15 +349,11 @@ cdef class Unpacker(object):
356349
free(self.buf)
357350
self.buf = NULL
358351

359-
def __init__(self, file_like=None, Py_ssize_t read_size=0, use_list=None,
352+
def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1,
360353
object object_hook=None, object list_hook=None,
361354
encoding=None, unicode_errors='strict', int max_buffer_size=0,
362355
object object_pairs_hook=None,
363356
):
364-
if use_list is None:
365-
warnings.warn("Set use_list explicitly.", category=DeprecationWarning, stacklevel=1)
366-
use_list = 0
367-
368357
self.file_like = file_like
369358
if file_like:
370359
self.file_like_read = file_like.read

0 commit comments

Comments
 (0)