Visitar URL original
Add type stubs. by hoefling · Pull Request #404 · msgpack/msgpack-python · GitHub
Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move the unpacker type var inside the unpacker class to ensure clean …
…a mypy run

Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
  • Loading branch information
hoefling committed Feb 21, 2020
commit 547beb6202d4ac96c9e685cf9a7dddb065072f41
2 changes: 1 addition & 1 deletion msgpack/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ else:
SupportsRead = BinaryIO
SupportsWrite = BinaryIO

_U = TypeVar("_U", bound=Unpacker)
_S = TypeVar("_S", bound=SupportsRead)

_ObjectHook = Callable[[Dict[Any, Any]], Any]
Expand Down Expand Up @@ -57,6 +56,7 @@ class ExtType(NamedTuple):
data: bytes

class Unpacker(Generic[_S]):
_U = TypeVar("_U", bound="Unpacker[_S]")
file_like: Optional[_S]
def __init__(
self,
Expand Down