From 69efd3ec56a76545389c1a36c51ebb2c3e0a3f5a Mon Sep 17 00:00:00 2001 From: Max Marrone Date: Mon, 23 Dec 2024 14:02:13 -0500 Subject: [PATCH] Rename _SomethingCallableLike -> _CallableLike --- .../fastapi_utils/light_router.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/server-utils/server_utils/fastapi_utils/light_router.py b/server-utils/server_utils/fastapi_utils/light_router.py index 67d75fdb646..82d82893151 100644 --- a/server-utils/server_utils/fastapi_utils/light_router.py +++ b/server-utils/server_utils/fastapi_utils/light_router.py @@ -30,9 +30,9 @@ _P = typing.ParamSpec("_P") _ReturnT = typing.TypeVar("_ReturnT") - # `_SomethingCallableLike(FastAPI.foo)` produces a callable with the same signature + # `_CallableLike(FastAPI.foo)` produces a callable with the same signature # as `FastAPI.foo()`. - class _SomethingCallableLike(typing.Generic[_P, _ReturnT]): + class _CallableLike(typing.Generic[_P, _ReturnT]): def __init__( self, method_to_mimic: typing.Callable[ @@ -49,14 +49,14 @@ def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _ReturnT: raise NotImplementedError("This is only for type-checking, not runtime.") class _FastAPIRouteMethods: - get: typing.Final = _SomethingCallableLike(fastapi.FastAPI.get) - put: typing.Final = _SomethingCallableLike(fastapi.FastAPI.put) - post: typing.Final = _SomethingCallableLike(fastapi.FastAPI.post) - delete: typing.Final = _SomethingCallableLike(fastapi.FastAPI.delete) - options: typing.Final = _SomethingCallableLike(fastapi.FastAPI.options) - head: typing.Final = _SomethingCallableLike(fastapi.FastAPI.head) - patch: typing.Final = _SomethingCallableLike(fastapi.FastAPI.patch) - trace: typing.Final = _SomethingCallableLike(fastapi.FastAPI.trace) + get: typing.Final = _CallableLike(fastapi.FastAPI.get) + put: typing.Final = _CallableLike(fastapi.FastAPI.put) + post: typing.Final = _CallableLike(fastapi.FastAPI.post) + delete: typing.Final = _CallableLike(fastapi.FastAPI.delete) + options: typing.Final = _CallableLike(fastapi.FastAPI.options) + head: typing.Final = _CallableLike(fastapi.FastAPI.head) + patch: typing.Final = _CallableLike(fastapi.FastAPI.patch) + trace: typing.Final = _CallableLike(fastapi.FastAPI.trace) else: