From 4c73096144d0c8f49e5c4d644303e5e0c9571e99 Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 12 Sep 2024 09:25:42 +0200 Subject: [PATCH] define empty zmq.asyncio.Context.__init__ for pyright pyright doesn't understand the type --- zmq/asyncio.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zmq/asyncio.py b/zmq/asyncio.py index e74084701..22bbd14d4 100644 --- a/zmq/asyncio.py +++ b/zmq/asyncio.py @@ -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.