From 35edfad336b778877c4f6e0cdf5ddf772b004fa6 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Fri, 21 Nov 2025 20:38:18 +0000 Subject: [PATCH] docstrings --- src/socketio/msgpack_packet.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/socketio/msgpack_packet.py b/src/socketio/msgpack_packet.py index 9622dd2..732d188 100644 --- a/src/socketio/msgpack_packet.py +++ b/src/socketio/msgpack_packet.py @@ -9,6 +9,18 @@ class MsgPackPacket(packet.Packet): @classmethod def configure(cls, dumps_default=None, ext_hook=msgpack.ExtType): + """Change the default options for msgpack encoding and decoding. + + :param dumps_default: a function called for objects that cannot be + serialized by default msgpack. The function + receives one argument, the object to serialize. + It should return a serializable object or a + ``msgpack.ExtType`` instance. + :param ext_hook: a function called when a ``msgpack.ExtType`` object is + seen during decoding. The function receives two + arguments, the code and the data. It should return the + decoded object. + """ class CustomMsgPackPacket(MsgPackPacket): dumps_default = None ext_hook = None