Skip to content

Commit

Permalink
define empty zmq.asyncio.Context.__init__ for pyright
Browse files Browse the repository at this point in the history
pyright doesn't understand the type
  • Loading branch information
minrk committed Sep 12, 2024
1 parent 0204cc4 commit 4c73096
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions zmq/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ class Context(_zmq.Context[Socket]):
# avoid sharing instance with base Context class
_instance = None

# overload with no changes to satisfy pyright
def __init__(
self: Context,
io_threads: int | _zmq.Context = 1,
shadow: _zmq.Context | int = 0,
) -> None:
super().__init__(io_threads, shadow) # type: ignore


class ZMQEventLoop(SelectorEventLoop):
"""DEPRECATED: AsyncIO eventloop using zmq_poll.
Expand Down

0 comments on commit 4c73096

Please sign in to comment.