From b5e51fe2a1327d42429dd12ef0b65103b14b2925 Mon Sep 17 00:00:00 2001 From: Sean Breckenridge Date: Wed, 26 Jan 2022 17:09:40 -0800 Subject: [PATCH] override dummyexecutor type signature --- my/core/common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/my/core/common.py b/my/core/common.py index 96ab44c..e2b7a37 100644 --- a/my/core/common.py +++ b/my/core/common.py @@ -607,7 +607,10 @@ class DummyExecutor(Executor): self._shutdown = False self._max_workers = max_workers - def submit(self, fn, *args, **kwargs) -> Future: + # TODO: once support for 3.7 is dropped, + # can make 'fn' a positional only parameter, + # which fixes the mypy error this throws without the type: ignore + def submit(self, fn, *args, **kwargs) -> Future: # type: ignore[override] if self._shutdown: raise RuntimeError('cannot schedule new futures after shutdown') @@ -623,5 +626,5 @@ class DummyExecutor(Executor): return f - def shutdown(self, wait: bool=True) -> None: + def shutdown(self, wait: bool=True) -> None: # type: ignore[override] self._shutdown = True