|
7 | 7 | from collections.abc import Sequence |
8 | 8 | from datetime import datetime as _DateTime |
9 | 9 |
|
10 | | -_ClassInfo: t.TypeAlias = type | types.UnionType | tuple['_ClassInfo', ...] |
| 10 | +_ClassInfo: t.TypeAlias = type | types.UnionType | tuple["_ClassInfo", ...] |
11 | 11 | _Pair = tuple[t.Any, t.Any] |
12 | 12 | _Pairs = t.Iterable[_Pair] |
13 | 13 | _SizeFmt = tuple[int, str] |
@@ -90,7 +90,7 @@ def unpackb(packed: bytes, **kwargs: dict[str, t.Any]): |
90 | 90 |
|
91 | 91 | See :class:`Unpacker` for options. |
92 | 92 | """ |
93 | | - unpacker = Unpacker(None, max_buffer_size=len(packed), **kwargs) # type: ignore |
| 93 | + unpacker = Unpacker(None, max_buffer_size=len(packed), **kwargs) # type: ignore |
94 | 94 | unpacker.feed(packed) |
95 | 95 | try: |
96 | 96 | ret = unpacker._unpack() |
@@ -528,19 +528,20 @@ def _unpack(self, execute=EX_CONSTRUCT): |
528 | 528 | return |
529 | 529 | if self._object_pairs_hook is not None: |
530 | 530 | 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 |
532 | 533 | ) |
533 | 534 | else: |
534 | 535 | ret = {} |
535 | 536 | for _ in range(n): |
536 | 537 | key = self._unpack(EX_CONSTRUCT) |
537 | 538 | 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 |
539 | 540 | if isinstance(key, str): |
540 | 541 | key = sys.intern(key) |
541 | 542 | ret[key] = self._unpack(EX_CONSTRUCT) |
542 | 543 | if self._object_hook is not None: |
543 | | - ret = self._object_hook(ret) # type: ignore |
| 544 | + ret = self._object_hook(ret) # type: ignore |
544 | 545 | return ret |
545 | 546 | if execute == EX_SKIP: |
546 | 547 | return |
|
0 commit comments