@@ -159,12 +159,18 @@ cdef class Packer(object):
159
159
160
160
161
161
def pack (object o , object stream , default = None , encoding = ' utf-8' , unicode_errors = ' strict' ):
162
- """ pack an object `o` and write it to stream)."""
162
+ """ \
163
+ pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict')
164
+
165
+ pack an object `o` and write it to stream)."""
163
166
packer = Packer(default = default, encoding = encoding, unicode_errors = unicode_errors)
164
167
stream.write(packer.pack(o))
165
168
166
169
def packb (object o , default = None , encoding = ' utf-8' , unicode_errors = ' strict' ):
167
- """ pack o and return packed bytes."""
170
+ """ \
171
+ packb(object o, default=None, encoding='utf-8', unicode_errors='strict')
172
+
173
+ pack o and return packed bytes."""
168
174
packer = Packer(default = default, encoding = encoding, unicode_errors = unicode_errors)
169
175
return packer.pack(o)
170
176
@@ -191,7 +197,11 @@ cdef extern from "unpack.h":
191
197
192
198
193
199
def unpackb (object packed , object object_hook = None , object list_hook = None , bint use_list = 0 , encoding = None , unicode_errors = " strict" ):
194
- """ Unpack packed_bytes to object. Returns an unpacked object."""
200
+ """ \
201
+ unpackb(object packed, object object_hook=None, object list_hook=None,
202
+ bint use_list=0, encoding=None, unicode_errors="strict")
203
+
204
+ Unpack packed_bytes to object. Returns an unpacked object."""
195
205
cdef template_context ctx
196
206
cdef size_t off = 0
197
207
cdef int ret
@@ -240,7 +250,11 @@ def unpackb(object packed, object object_hook=None, object list_hook=None, bint
240
250
241
251
242
252
def unpack (object stream , object object_hook = None , object list_hook = None , bint use_list = 0 , encoding = None , unicode_errors = " strict" ):
243
- """ unpack an object from stream."""
253
+ """ \
254
+ unpack(object stream, object object_hook=None, object list_hook=None,
255
+ bint use_list=0, encoding=None, unicode_errors="strict")
256
+
257
+ unpack an object from stream."""
244
258
return unpackb(stream.read(), use_list = use_list,
245
259
object_hook = object_hook, list_hook = list_hook, encoding = encoding, unicode_errors = unicode_errors)
246
260
0 commit comments