Browse Source

type hint changes

pull/11895/head
Alexander 'Leo' Bergolth 11 months ago
parent
commit
bf38db2c4b
  1. 7
      fastapi/concurrency.py

7
fastapi/concurrency.py

@ -19,9 +19,10 @@ _P = ParamSpec("_P")
_T = TypeVar("_T") _T = TypeVar("_T")
async def run_in_threadpool( async def run_in_threadpool(
func: typing.Callable[_P, _T], *args: _P.args, func: typing.Callable[_P, _T],
_limiter: Optional[anyio.CapacityLimiter] = None, *args: typing.Any,
**kwargs: _P.kwargs _limiter: Optional[anyio.CapacityLimiter] = None,
**kwargs: typing.Any
) -> _T: ) -> _T:
if kwargs: # pragma: no cover if kwargs: # pragma: no cover
# run_sync doesn't accept 'kwargs', so bind them in here # run_sync doesn't accept 'kwargs', so bind them in here

Loading…
Cancel
Save