str(JsProxy)
raising TypeError
#4569
-
When I try to TypeError: Pyodide cannot generate a repr for this Javascript object because it has no 'toString' method Note that the To Reproduce>>> from pyodide.code import run_js
>>> a_simple_module = await run_js("import('https://esm.run/partial-json')")
>>> str(a_simple_module) Expected behavior
Environmentthe |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I know a I think, in python, |
Beta Was this translation helpful? Give feedback.
-
Thanks for the report! We probably should fall back to To avoid the request, a better repro is: from pyodide.code import run_js
mod = await run_js("import('data:text/javascript,')")
print(mod) |
Beta Was this translation helpful? Give feedback.
Thanks for the report! We probably should fall back to
Object.prototype.toString.call
in this case. That would render it as'[object Module]'
which isn't useful persay but at least doesn't throw. @ryanking13 wdyt?To avoid the request, a better repro is: