1
1
from __future__ import annotations
2
2
3
- from ..session import Inputs , Outputs , Session
3
+ # Import these with underscore names so they won't show in autocomplete from the Python
4
+ # console.
5
+ from ..session import Inputs as _Inputs , Outputs as _Outputs , Session as _Session
4
6
from ..session import _utils as _session_utils
5
- from . import app , ui
7
+ from . import ui
6
8
from ._is_express import is_express_app
7
9
from ._output import output_args , suspend_display
8
10
from ._run import wrap_express_app
16
18
"output_args" ,
17
19
"suspend_display" ,
18
20
"wrap_express_app" ,
19
- "app" ,
20
21
"ui" ,
21
22
"display_body" ,
22
23
)
23
24
24
25
# Add types to help type checkers
25
- input : Inputs
26
- output : Outputs
27
- session : Session
26
+ input : _Inputs
27
+ output : _Outputs
28
+ session : _Session
28
29
29
30
30
31
# Note that users should use `from shiny.express import input` instead of `from shiny
@@ -50,8 +51,8 @@ def __init__(self):
50
51
51
52
from .._namespaces import Root
52
53
53
- self .input = Inputs ({})
54
- self .output = Outputs (cast (Session , self ), Root , {}, {})
54
+ self .input = _Inputs ({})
55
+ self .output = _Outputs (cast (_Session , self ), Root , {}, {})
55
56
56
57
# This is needed so that Outputs don't throw an error.
57
58
def _is_hidden (self , name : str ) -> bool :
@@ -61,15 +62,15 @@ def _is_hidden(self, name: str) -> bool:
61
62
_current_mock_session : _MockSession | None = None
62
63
63
64
64
- def _get_current_session_or_mock () -> Session :
65
+ def _get_current_session_or_mock () -> _Session :
65
66
from typing import cast
66
67
67
68
session = _session_utils .get_current_session ()
68
69
if session is None :
69
70
global _current_mock_session
70
71
if _current_mock_session is None :
71
72
_current_mock_session = _MockSession ()
72
- return cast (Session , _current_mock_session )
73
+ return cast (_Session , _current_mock_session )
73
74
74
75
else :
75
76
return session
0 commit comments