Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove dead code until python 3.8 support is dropped #1238

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions shiny/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 0 additions & 3 deletions shiny/render/renderer/_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
Loading