Skip to content

Commit 41700db

Browse files
bellini666carltongibson
authored andcommitted
chore: remove not needed anymore typing workaround
1 parent ef1678a commit 41700db

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

asgiref/current_thread_executor.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import threading
33
from collections import deque
44
from concurrent.futures import Executor, Future
5-
from typing import TYPE_CHECKING, Any, Callable, TypeVar
5+
from typing import Any, Callable, TypeVar
66

77
if sys.version_info >= (3, 10):
88
from typing import ParamSpec
@@ -90,9 +90,10 @@ def done(future: "Future[Any]") -> None:
9090
work_item.run()
9191
del work_item
9292

93-
def _submit(
93+
def submit(
9494
self,
9595
fn: Callable[_P, _R],
96+
/,
9697
*args: _P.args,
9798
**kwargs: _P.kwargs,
9899
) -> "Future[_R]":
@@ -120,13 +121,3 @@ def _submit(
120121

121122
# Return the future
122123
return f
123-
124-
# Python 3.9+ has a new signature for submit with a "/" after `fn`, to enforce
125-
# it to be a positional argument. If we ignore[override] mypy on 3.9+ will be
126-
# happy but 3.8 will say that the ignore comment is unused, even when
127-
# defining them differently based on sys.version_info.
128-
# We should be able to remove this when we drop support for 3.8.
129-
if not TYPE_CHECKING:
130-
131-
def submit(self, fn, *args, **kwargs):
132-
return self._submit(fn, *args, **kwargs)

0 commit comments

Comments
 (0)