Skip to content

Commit

Permalink
Merge pull request #2032 from minrk/pylance
Browse files Browse the repository at this point in the history
define empty zmq.asyncio.Context.__init__ for pyright
  • Loading branch information
minrk committed Sep 22, 2024
2 parents 0204cc4 + 4c73096 commit 25168fc
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 25168fc

Please sign in to comment.