mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-13 19:04:16 +00:00
packb supports use_single_float option.
This commit is contained in:
parent
397d772e11
commit
51335bbee4
3 changed files with 16 additions and 3 deletions
|
|
@ -177,10 +177,11 @@ def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors
|
|||
packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors)
|
||||
stream.write(packer.pack(o))
|
||||
|
||||
def packb(object o, default=None, encoding='utf-8', unicode_errors='strict'):
|
||||
def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False):
|
||||
"""
|
||||
pack o and return packed bytes."""
|
||||
packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors)
|
||||
packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors,
|
||||
use_single_float=use_single_float)
|
||||
return packer.pack(o)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue