8000 Add signature to docstring. · scott2b/msgpack-python@5ed2288 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.

Commit 5ed2288

Browse files
committed
Add signature to docstring.
1 parent 8361fd8 commit 5ed2288

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

msgpack/_msgpack.pyx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,18 @@ cdef class Packer(object):
159159

160160

161161
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)."""
163166
packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors)
164167
stream.write(packer.pack(o))
165168

166169
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."""
168174
packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors)
169175
return packer.pack(o)
170176

@@ -191,7 +197,11 @@ cdef extern from "unpack.h":
191197

192198

193199
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."""
195205
cdef template_context ctx
196206
cdef size_t off = 0
197207
cdef int ret
@@ -240,7 +250,11 @@ def unpackb(object packed, object object_hook=None, object list_hook=None, bint
240250

241251

242252
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."""
244258
return unpackb(stream.read(), use_list=use_list,
245259
object_hook=object_hook, list_hook=list_hook, encoding=encoding, unicode_errors=unicode_errors)
246260

0 commit comments

Comments
 (0)
0