From d1d997d6fc05947c56b39fb83a02db01dd8bc66a Mon Sep 17 00:00:00 2001 From: Samir Ahmane Date: Mon, 18 May 2026 22:45:23 +0100 Subject: [PATCH] fix: uncomment var definition --- fastapi/routing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 0d36cf4d82..3abe0f2eb0 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -257,7 +257,8 @@ class EndpointContext(TypedDict, total=False): # Use a WeakKeyDictionary instead of a standard dict to prevent memory leaks # and cache collisions when endpoints are dynamically created and destroyed. -# This cache will only be used for the fallback "slow path"._endpoint_context_cache: weakref.WeakKeyDictionary[Any, EndpointContext] = weakref.WeakKeyDictionary() +# This cache will only be used for the fallback "slow path". +_endpoint_context_cache: weakref.WeakKeyDictionary[Any, EndpointContext] = weakref.WeakKeyDictionary() def _extract_endpoint_context(func: Any) -> EndpointContext: """Extract endpoint context with caching to avoid repeated file I/O."""