mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-06 17:59:52 +00:00
fix typing
This commit is contained in:
parent
b9d495db40
commit
95d1b4dc64
2 changed files with 4 additions and 4 deletions
|
|
@ -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`.
|
||||
|
||||
|
|
|
|||
|
|
@ -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`.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue