diff --git a/shiny/_fileupload.py b/shiny/_fileupload.py index bae799909..c72505baa 100644 --- a/shiny/_fileupload.py +++ b/shiny/_fileupload.py @@ -1,5 +1,3 @@ -# Needed for types imported only during TYPE_CHECKING with Python 3.7 - 3.9 -# See https://www.python.org/dev/peps/pep-0655/#usage-in-python-3-11 from __future__ import annotations import copy diff --git a/shiny/_namespaces.py b/shiny/_namespaces.py index 5b635cc23..93ab1e7ed 100644 --- a/shiny/_namespaces.py +++ b/shiny/_namespaces.py @@ -1,5 +1,3 @@ -# Needed for types imported only during TYPE_CHECKING with Python 3.7 - 3.9 -# See https://www.python.org/dev/peps/pep-0655/#usage-in-python-3-11 from __future__ import annotations import re diff --git a/shiny/input_handler.py b/shiny/input_handler.py index 01d86067e..8c9238e0b 100644 --- a/shiny/input_handler.py +++ b/shiny/input_handler.py @@ -1,5 +1,3 @@ -# Needed for types imported only during TYPE_CHECKING with Python 3.7 - 3.9 -# See https://www.python.org/dev/peps/pep-0655/#usage-in-python-3-11 from __future__ import annotations __all__ = ("input_handlers",) diff --git a/shiny/module.py b/shiny/module.py index c4001b3b9..be2422e57 100644 --- a/shiny/module.py +++ b/shiny/module.py @@ -20,6 +20,9 @@ P = ParamSpec("P") R = TypeVar("R") +# Ensure that Id type is not stripped out from .pyi file when generating type stubs +_: Id # type: ignore + @no_example() def ui(fn: Callable[P, R]) -> Callable[Concatenate[str, P], R]: diff --git a/shiny/plotutils.py b/shiny/plotutils.py index 85aebac8a..3c60eeb96 100644 --- a/shiny/plotutils.py +++ b/shiny/plotutils.py @@ -1,7 +1,5 @@ # pyright: reportUnknownArgumentType=false -# Needed for types imported only during TYPE_CHECKING with Python 3.7 - 3.9 -# See https://www.python.org/dev/peps/pep-0655/#usage-in-python-3-11 from __future__ import annotations __all__ = ("brushed_points", "near_points") diff --git a/shiny/session/_session.py b/shiny/session/_session.py index 92f27374b..e2b02a2ef 100644 --- a/shiny/session/_session.py +++ b/shiny/session/_session.py @@ -1,5 +1,3 @@ -# Needed for types imported only during TYPE_CHECKING with Python 3.7 - 3.9 -# See https://www.python.org/dev/peps/pep-0655/#usage-in-python-3-11 from __future__ import annotations __all__ = ("Session", "Inputs", "Outputs") diff --git a/shiny/session/_utils.py b/shiny/session/_utils.py index 637b6e83d..fda6efd6b 100644 --- a/shiny/session/_utils.py +++ b/shiny/session/_utils.py @@ -1,5 +1,3 @@ -# Needed for types imported only during TYPE_CHECKING with Python 3.7 - 3.9 -# See https://www.python.org/dev/peps/pep-0655/#usage-in-python-3-11 from __future__ import annotations __all__ = (