From 0f8c4e82008d13a78b04683b091e64e69d88fb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Tue, 2 Dec 2025 14:25:30 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Make=20new=20attribute=20D?= =?UTF-8?q?ependant.=5Funwrapped=5Fcall=20private?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/dependencies/models.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fastapi/dependencies/models.py b/fastapi/dependencies/models.py index 2eb4dd3f9..13486dd18 100644 --- a/fastapi/dependencies/models.py +++ b/fastapi/dependencies/models.py @@ -76,32 +76,32 @@ class Dependant: return False @cached_property - def unwrapped_call(self) -> Any: + def _unwrapped_call(self) -> Any: if self.call is None: return self.call # pragma: no cover return inspect.unwrap(self.call) @cached_property def is_gen_callable(self) -> bool: - if inspect.isgeneratorfunction(self.unwrapped_call): + if inspect.isgeneratorfunction(self._unwrapped_call): return True - dunder_call = getattr(self.unwrapped_call, "__call__", None) # noqa: B004 + dunder_call = getattr(self._unwrapped_call, "__call__", None) # noqa: B004 return inspect.isgeneratorfunction(dunder_call) @cached_property def is_async_gen_callable(self) -> bool: - if inspect.isasyncgenfunction(self.unwrapped_call): + if inspect.isasyncgenfunction(self._unwrapped_call): return True - dunder_call = getattr(self.unwrapped_call, "__call__", None) # noqa: B004 + dunder_call = getattr(self._unwrapped_call, "__call__", None) # noqa: B004 return inspect.isasyncgenfunction(dunder_call) @cached_property def is_coroutine_callable(self) -> bool: - if inspect.isroutine(self.unwrapped_call): - return iscoroutinefunction(self.unwrapped_call) - if inspect.isclass(self.unwrapped_call): + if inspect.isroutine(self._unwrapped_call): + return iscoroutinefunction(self._unwrapped_call) + if inspect.isclass(self._unwrapped_call): return False - dunder_call = getattr(self.unwrapped_call, "__call__", None) # noqa: B004 + dunder_call = getattr(self._unwrapped_call, "__call__", None) # noqa: B004 return iscoroutinefunction(dunder_call) @cached_property