.. versionadded:: 2018.3.4 Wraps msgpack.pack and ensures that the passed object is unwrapped if it is a proxy. By default, this function uses the msgpack module and falls back to msgpack_pure, if the msgpack is not available.
(o, stream, **kwargs)
| 94 | |
| 95 | |
| 96 | def pack(o, stream, **kwargs): |
| 97 | """ |
| 98 | .. versionadded:: 2018.3.4 |
| 99 | |
| 100 | Wraps msgpack.pack and ensures that the passed object is unwrapped if it is |
| 101 | a proxy. |
| 102 | |
| 103 | By default, this function uses the msgpack module and falls back to |
| 104 | msgpack_pure, if the msgpack is not available. |
| 105 | """ |
| 106 | if not msgpack: |
| 107 | raise RuntimeError("msgpack is not available") |
| 108 | # Writes to a stream, there is no return |
| 109 | msgpack.pack(o, stream, **_sanitize_msgpack_kwargs(kwargs)) |
| 110 | |
| 111 | |
| 112 | def packb(o, **kwargs): |
nothing calls this directly
no test coverage detected