diff --git a/shiny/_utils.py b/shiny/_utils.py index f9a180b28..30a3b0f0d 100644 --- a/shiny/_utils.py +++ b/shiny/_utils.py @@ -265,60 +265,6 @@ async def fn_async(*args: P.args, **kwargs: P.kwargs) -> R: return fn_async -# # TODO-barret-future; Q: Keep code? -# class WrapAsync(Generic[P, R]): -# """ -# Make a function asynchronous. - -# Parameters -# ---------- -# fn -# Function to make asynchronous. - -# Returns -# ------- -# : -# Asynchronous function (within the `WrapAsync` instance) -# """ - -# def __init__(self, fn: Callable[P, R] | Callable[P, Awaitable[R]]): -# if isinstance(fn, WrapAsync): -# fn = cast(WrapAsync[P, R], fn) -# return fn -# self._is_async = is_async_callable(fn) -# self._fn = wrap_async(fn) - -# async def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R: -# """ -# Call the asynchronous function. -# """ -# return await self._fn(*args, **kwargs) - -# @property -# def is_async(self) -> bool: -# """ -# Was the original function asynchronous? - -# Returns -# ------- -# : -# Whether the original function is asynchronous. -# """ -# return self._is_async - -# @property -# def fn(self) -> Callable[P, R] | Callable[P, Awaitable[R]]: -# """ -# Retrieve the original function - -# Returns -# ------- -# : -# Original function supplied to the `WrapAsync` constructor. -# """ -# return self._fn - - # This function should generally be used in this code base instead of # `iscoroutinefunction()`. def is_async_callable( diff --git a/shiny/render/renderer/_renderer.py b/shiny/render/renderer/_renderer.py index bec6e0350..707dbfc1d 100644 --- a/shiny/render/renderer/_renderer.py +++ b/shiny/render/renderer/_renderer.py @@ -319,9 +319,6 @@ def _auto_register(self) -> None: self._auto_registered = True -# Not inheriting from `WrapAsync[[], IT]` as python 3.8 needs typing extensions that -# doesn't support `[]` for a ParamSpec definition. :-( Would be minimal/clean if we -# could do `class AsyncValueFn(WrapAsync[[], IT]):` class AsyncValueFn(Generic[IT]): """ App-supplied output value function which returns type `IT`.