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

Update express.ui.hold() to accept any type of object #1089

Merged
merged 1 commit into from
Feb 1, 2024
Merged
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
5 changes: 2 additions & 3 deletions shiny/express/ui/_hold.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from htmltools import wrap_displayhook_handler

from ... import ui
from ..._typing_extensions import ParamSpec

__all__ = ("hold",)
Expand Down Expand Up @@ -45,9 +44,9 @@ def hold() -> HoldContextManager:

class HoldContextManager:
def __init__(self):
self.content = ui.TagList()
self.content: list[object] = list()

def __enter__(self) -> ui.TagList:
def __enter__(self) -> list[object]:
self.prev_displayhook = sys.displayhook
sys.displayhook = wrap_displayhook_handler(
self.content.append # pyright: ignore[reportArgumentType]
Expand Down
Loading