diff options
author | TW <tw@waldmann-edv.de> | 2017-01-11 04:04:23 +0100 |
---|---|---|
committer | INADA Naoki <methane@users.noreply.github.com> | 2017-01-11 12:04:23 +0900 |
commit | e3fea94509767047a8ff45aa07cd58a9ba9694e7 (patch) | |
tree | 9a4cceb6a1967c8f83263cea13c4f80af901cef4 /msgpack/_packer.pyx | |
parent | a9f4dad4dcde4db148f22720c694e5b5e0cb6f2d (diff) | |
download | msgpack-python-release-0.4.tar.gz |
fix typos and other cosmetic issues (#214)release-0.4
cosmetic issues:
- reST headlines' underline length needs to match the headline length
(looks like somebody is / was using a proportional font)
- Cython code lines do not need to be terminated with a semicolon
- always use triple-double-quotes for docstrings
Diffstat (limited to 'msgpack/_packer.pyx')
-rw-r--r-- | msgpack/_packer.pyx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/msgpack/_packer.pyx b/msgpack/_packer.pyx index 872465b..7a12853 100644 --- a/msgpack/_packer.pyx +++ b/msgpack/_packer.pyx @@ -58,11 +58,11 @@ cdef class Packer(object): :param bool use_single_float: Use single precision float type for float. (default: False) :param bool autoreset: - Reset buffer after each pack and return it's content as `bytes`. (default: True). + Reset buffer after each pack and return its content as `bytes`. (default: True). If set this to false, use `bytes()` to get content and `.reset()` to clear buffer. :param bool use_bin_type: Use bin type introduced in msgpack spec 2.0 for bytes. - It also enable str8 type for unicode. + It also enables str8 type for unicode. """ cdef msgpack_packer pk cdef object _default @@ -75,7 +75,7 @@ cdef class Packer(object): def __cinit__(self): cdef int buf_size = 1024*1024 - self.pk.buf = <char*> malloc(buf_size); + self.pk.buf = <char*> malloc(buf_size) if self.pk.buf == NULL: raise MemoryError("Unable to allocate internal buffer.") self.pk.buf_size = buf_size @@ -108,7 +108,7 @@ cdef class Packer(object): self.unicode_errors = PyBytes_AsString(self._berrors) def __dealloc__(self): - free(self.pk.buf); + free(self.pk.buf) cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: cdef long long llval @@ -274,7 +274,7 @@ cdef class Packer(object): """ Pack *pairs* as msgpack map type. - *pairs* should sequence of pair. + *pairs* should be a sequence of pairs. (`len(pairs)` and `for k, v in pairs:` should be supported.) """ cdef int ret = msgpack_pack_map(&self.pk, len(pairs)) |