From 95d1b4dc642c037f573f62d23018b494168447af Mon Sep 17 00:00:00 2001 From: peasoft Date: Sat, 3 Jan 2026 14:13:05 +0800 Subject: [PATCH] fix typing --- msgpack/__init__.py | 6 +++--- msgpack/fallback.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/msgpack/__init__.py b/msgpack/__init__.py index 4a050ff..019d70b 100644 --- a/msgpack/__init__.py +++ b/msgpack/__init__.py @@ -19,7 +19,7 @@ else: from .fallback import Packer, Unpacker, unpackb -def pack(o: t.Any, stream: t.BinaryIO, **kwargs: dict[str, t.Any]): +def pack(o: t.Any, stream: t.BinaryIO, **kwargs: t.Any): """ Pack object `o` and write it to `stream` @@ -29,7 +29,7 @@ def pack(o: t.Any, stream: t.BinaryIO, **kwargs: dict[str, t.Any]): stream.write(t.cast(bytes, packer.pack(o))) -def packb(o: t.Any, **kwargs: dict[str, t.Any]): +def packb(o: t.Any, **kwargs: t.Any) -> bytes: """ Pack object `o` and return packed bytes @@ -38,7 +38,7 @@ def packb(o: t.Any, **kwargs: dict[str, t.Any]): return Packer(autoreset=True, **kwargs).pack(o) # type: ignore -def unpack(stream: t.BinaryIO, **kwargs: dict[str, t.Any]): +def unpack(stream: t.BinaryIO, **kwargs: t.Any): """ Unpack an object from `stream`. diff --git a/msgpack/fallback.py b/msgpack/fallback.py index 6931123..f87757b 100644 --- a/msgpack/fallback.py +++ b/msgpack/fallback.py @@ -78,7 +78,7 @@ def _get_data_from_buffer(obj: bytes): return view -def unpackb(packed: bytes, **kwargs: dict[str, t.Any]): +def unpackb(packed: bytes, **kwargs: t.Any): """ Unpack an object from `packed`.