summaryrefslogtreecommitdiff
path: root/msgpack/_msgpack.pyx
diff options
context:
space:
mode:
authorINADA Naoki <songofacandy@gmail.com>2011-01-09 23:17:20 +0900
committerINADA Naoki <songofacandy@gmail.com>2011-01-09 23:17:20 +0900
commit569729c3c218cdbb87b486524ab1e71c1f8bba61 (patch)
tree87acbfb1b33df635948d7805090dfa0b4ec12a55 /msgpack/_msgpack.pyx
parent9c61ce2c6cb8f87d6d928ef728a882bf141ccaf2 (diff)
downloadmsgpack-python-569729c3c218cdbb87b486524ab1e71c1f8bba61.tar.gz
python: Make aliases for API compatibility to pickle.
``dumps`` is alias of ``packb`` and ``loads`` is alias of ``unpacks``.
Diffstat (limited to 'msgpack/_msgpack.pyx')
-rw-r--r--msgpack/_msgpack.pyx5
1 files changed, 2 insertions, 3 deletions
diff --git a/msgpack/_msgpack.pyx b/msgpack/_msgpack.pyx
index 5394055..3316a22 100644
--- a/msgpack/_msgpack.pyx
+++ b/msgpack/_msgpack.pyx
@@ -73,7 +73,6 @@ cdef class Packer(object):
if o is None:
ret = msgpack_pack_nil(&self.pk)
- #elif PyBool_Check(o):
elif isinstance(o, bool):
if o:
ret = msgpack_pack_true(&self.pk)
@@ -145,7 +144,7 @@ def packb(object o, default=None):
packer = Packer(default=default)
return packer.pack(o)
-packs = packb
+dumps = packs = packb
cdef extern from "unpack.h":
ctypedef struct msgpack_user:
@@ -193,7 +192,7 @@ def unpackb(object packed, object object_hook=None, object list_hook=None):
else:
return None
-unpacks = unpackb
+loads = unpacks = unpackb
def unpack(object stream, object object_hook=None, object list_hook=None):
"""unpack an object from stream."""