mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 02:37:41 -05:00
Updated Polyscript with its workers feature (#2104)
* Updated Polyscript with its workers feature * Worked around the inconsistent behavior between Pyodide and MicroPython * Fixed Pyodide greedy access to undesired Proxy fields
This commit is contained in:
committed by
GitHub
parent
7b8ef7ebe2
commit
6f49f18937
19
pyscript.core/test/workers/test.py
Normal file
19
pyscript.core/test/workers/test.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from pyscript import document, workers
|
||||
|
||||
|
||||
async def test(interpreter):
|
||||
# accessed as item
|
||||
named = await workers.micropython_version
|
||||
|
||||
version = await named.micropython_version()
|
||||
document.body.append(version)
|
||||
document.body.append(document.createElement("hr"))
|
||||
|
||||
# accessed as attribute
|
||||
named = await workers["pyodide_version"]
|
||||
|
||||
version = await named.pyodide_version()
|
||||
document.body.append(version)
|
||||
document.body.append(document.createElement("hr"))
|
||||
|
||||
document.documentElement.classList.add(interpreter)
|
||||
Reference in New Issue
Block a user