Skip to content

Commit b9d495d

Browse files
committed
fix lint
1 parent 1c33b7e commit b9d495d

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

msgpack/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def pack(o: t.Any, stream: t.BinaryIO, **kwargs: dict[str, t.Any]):
2525
2626
See :class:`Packer` for options.
2727
"""
28-
packer = Packer(autoreset=True, **kwargs) # type: ignore
28+
packer = Packer(autoreset=True, **kwargs) # type: ignore
2929
stream.write(t.cast(bytes, packer.pack(o)))
3030

3131

@@ -35,7 +35,7 @@ def packb(o: t.Any, **kwargs: dict[str, t.Any]):
3535
3636
See :class:`Packer` for options.
3737
"""
38-
return Packer(autoreset=True, **kwargs).pack(o) # type: ignore
38+
return Packer(autoreset=True, **kwargs).pack(o) # type: ignore
3939

4040

4141
def unpack(stream: t.BinaryIO, **kwargs: dict[str, t.Any]):

msgpack/ext.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
class ExtType(namedtuple("ExtType", "code data")):
88
"""ExtType represents ext type in msgpack."""
9+
910
code: int
1011
data: bytes
1112

@@ -16,7 +17,7 @@ def __new__(cls, code: int, data: bytes):
1617
raise TypeError("data must be bytes")
1718
if not 0 <= code <= 127:
1819
raise ValueError("code must be 0~127")
19-
return super().__new__(cls, code, data) # type: ignore
20+
return super().__new__(cls, code, data) # type: ignore
2021

2122

2223
class Timestamp:

msgpack/fallback.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from collections.abc import Sequence
88
from datetime import datetime as _DateTime
99

10-
_ClassInfo: t.TypeAlias = type | types.UnionType | tuple['_ClassInfo', ...]
10+
_ClassInfo: t.TypeAlias = type | types.UnionType | tuple["_ClassInfo", ...]
1111
_Pair = tuple[t.Any, t.Any]
1212
_Pairs = t.Iterable[_Pair]
1313
_SizeFmt = tuple[int, str]
@@ -90,7 +90,7 @@ def unpackb(packed: bytes, **kwargs: dict[str, t.Any]):
9090
9191
See :class:`Unpacker` for options.
9292
"""
93-
unpacker = Unpacker(None, max_buffer_size=len(packed), **kwargs) # type: ignore
93+
unpacker = Unpacker(None, max_buffer_size=len(packed), **kwargs) # type: ignore
9494
unpacker.feed(packed)
9595
try:
9696
ret = unpacker._unpack()
@@ -528,19 +528,20 @@ def _unpack(self, execute=EX_CONSTRUCT):
528528
return
529529
if self._object_pairs_hook is not None:
530530
ret = self._object_pairs_hook(
531-
(self._unpack(EX_CONSTRUCT), self._unpack(EX_CONSTRUCT)) for _ in range(n) # type: ignore
531+
(self._unpack(EX_CONSTRUCT), self._unpack(EX_CONSTRUCT))
532+
for _ in range(n) # type: ignore
532533
)
533534
else:
534535
ret = {}
535536
for _ in range(n):
536537
key = self._unpack(EX_CONSTRUCT)
537538
if self._strict_map_key and type(key) not in (str, bytes):
538-
raise ValueError("%s is not allowed for map key" % str(type(key))) # type: ignore
539+
raise ValueError("%s is not allowed for map key" % str(type(key))) # type: ignore
539540
if isinstance(key, str):
540541
key = sys.intern(key)
541542
ret[key] = self._unpack(EX_CONSTRUCT)
542543
if self._object_hook is not None:
543-
ret = self._object_hook(ret) # type: ignore
544+
ret = self._object_hook(ret) # type: ignore
544545
return ret
545546
if execute == EX_SKIP:
546547
return

0 commit comments

Comments
 (0)