mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-04-10 05:20:17 +00:00
Add support for bypassing pre-packed data
This commit is contained in:
parent
f9806368ae
commit
e4ec35b7d3
4 changed files with 21 additions and 3 deletions
|
|
@ -8,7 +8,7 @@ from cpython.datetime cimport (
|
|||
cdef ExtType
|
||||
cdef Timestamp
|
||||
|
||||
from .ext import ExtType, Timestamp
|
||||
from .ext import ExtType, Timestamp, Bypass
|
||||
|
||||
|
||||
cdef extern from "Python.h":
|
||||
|
|
@ -222,6 +222,8 @@ cdef class Packer:
|
|||
llval = o.seconds
|
||||
ulval = o.nanoseconds
|
||||
msgpack_pack_timestamp(&self.pk, llval, ulval)
|
||||
elif type(o) is Bypass:
|
||||
msgpack_pack_raw_body(&self.pk, o.data, len(o.data))
|
||||
elif PyList_CheckExact(o) if strict else (PyTuple_Check(o) or PyList_Check(o)):
|
||||
L = Py_SIZE(o)
|
||||
if L > ITEM_LIMIT:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue