posit-dev / posit-dev/shinylive

running help(App) in web python console raises SyntaxError

Open
#9 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
251
Forks
25
Avg merge
19m
Merged PRs (30d)
2

Description

running the following lines in the web python consoles raises a SyntaxError:

>>> from shiny import App
>>> help(App)
Help on class App in module shiny._app:
class App(builtins.object)
 |  App(ui: Union[htmltools._core.Tag, htmltools._core.TagList], server: Optional[Callable, *, static_asset
s: Union[str, ForwardRef('os.PathLike[str]'), NoneType] = None, debug: bool = False) -> None
 |  
 |  Create a Shiny app instance.
 |  
 |  Parameters
 |  ----------
 |  ui
 |      The UI definition for the app (e.g., a call to :func:`~shiny.ui.page_fluid`
 |      with nested controls).
 |  server
 |      A function which is called once for each session, ensuring that each app is
 |      independent.
 |  static_assets
 |      An absolute directory containing static files to be served by the app.
 |  debug
 |      Whether to enable debug mode.
 |  
 |  Example
 |  -------
 |  
 |  .. code-block:: python
-- more --
 |  
 |      from shiny import *
 |  
 |      app_ui = ui.page_fluid("Hello Shiny!")
 |  
 |      def server(input: Inputs, output: Outputs, session: Session):
 |          pass
 |  
 |      app = App(app_ui, server)
 |  
 |  Methods defined here:
 |  
 |  async __call__(self, scope: MutableMapping[str, Any], receive: Callable], send: Callable, Awaitable[Non
eType]]) -> None
 |      Call self as a function.
 |  
 |  __init__(self, ui: Union[htmltools._core.Tag, htmltools._core.TagList], server: Optional[Callable, *, s
tatic_assets: Union[str, ForwardRef('os.PathLike[str]'), NoneType] = None, debug: bool = False) -> None
 |      Initialize self.  See help(type(self)) for accurate signature.
 |  
 |  async call_pyodide(self, scope: MutableMapping[str, Any], receive: Callable], send: Callable, Awaitable
[NoneType]]) -> None
 |      Communicate with pyodide.
 |      
 |      Warning
 |      -------
 |      This method is not intended for public usage. It's exported for use by
-- more --
 |      shinylive.
 |  
 |  init_starlette_app(self)
 |  
 |  run(self, **kwargs: object) -> None
 |      Run the app.
 |      
 |      Parameters
 |      ----------
 |      kwargs
 |          Keyword arguments passed to :func:`~shiny.run_app`.
 |  
 |  async stop(self) -> None
 |      Stop the app (i.e., close all sessions).
 |      
 |      See Also
 |      --------
 |      ~shiny.Session.close
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
-- more --
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |  
 |  __annotations__ = {'lib_prefix': <class 'str'>, 'sanitize_error_msg': ...
 |  
 |  lib_prefix = 'lib/'
 |  
 |  sanitize_error_msg = 'An error has occurred. Check your logs or contac...
 |  
 |  sanitize_errors = False
  File "<exec>", line 1
    shiny.session._session.Inputs, shiny.session._session.Outputs, shiny.session._session.Session], NoneTyp
e
                                                                                                 ^
SyntaxError: unmatched ']'
  File "<exec>", line 1
    ], Awaitable[MutableMapping[str, Any
    ^
SyntaxError: unmatched ']'
  File "<exec>", line 1
    MutableMapping[str, Any
                  ^
SyntaxError: '[' was never closed
  File "<exec>", line 1
    shiny.session._session.Inputs, shiny.session._session.Outputs, shiny.session._session.Session], NoneTyp
e
                                                                                                 ^
SyntaxError: unmatched ']'
  File "<exec>", line 1
    ], Awaitable[MutableMapping[str, Any
    ^
SyntaxError: unmatched ']'
  File "<exec>", line 1
    MutableMapping[str, Any
                  ^
SyntaxError: '[' was never closed

py-shinylive_help_app_syntax_error_20220719_1
py-shinylive_help_app_syntax_error_20220719_2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in the web Python console with from shiny import App followed by help(App), then inspect the console handling of the rendered help output. The issue names no source file or test; done means the command completes without the reported SyntaxError messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.