From 3527f2257214e63122a35a1d4a427284fb17f94b Mon Sep 17 00:00:00 2001 From: Tono Developer <140466016+tono9876@users.noreply.github.com> Date: Fri, 3 Jul 2026 11:51:59 +0700 Subject: [PATCH] docs: add docstring to contextmanager_in_threadpool Add missing docstring to the contextmanager_in_threadpool utility function in fastapi/concurrency.py. --- fastapi/concurrency.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fastapi/concurrency.py b/fastapi/concurrency.py index 76a5a2eb1..281647b80 100644 --- a/fastapi/concurrency.py +++ b/fastapi/concurrency.py @@ -16,6 +16,14 @@ _T = TypeVar("_T") @asynccontextmanager async def contextmanager_in_threadpool( + """Run a context manager in a thread pool. + + Args: + cm: The context manager to run. + + Returns: + The result of the context manager. + """ cm: AbstractContextManager[_T], ) -> AsyncGenerator[_T, None]: # blocking __exit__ from running waiting on a free thread