Replies: 3 comments 20 replies
-
@JeffersGlass any thoughts around this? I don't see "why not", personally ... btw, we enabled async top-level await by default recently, I am not even sure that works already with the current state. |
Beta Was this translation helpful? Give feedback.
-
So ... I've just tried this page and everything works already in both Pyodide and MicroPython ... it doesn't cover the option for <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@pyscript/core/dist/core.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/@pyscript/core/dist/core.js"></script>
</head>
<body>
<script type="mpy">
from pyscript import window, document, fetch, when
@when('click', '#click')
async def click(event):
text = await fetch(window.location.href).text()
document.getElementById('output').append(text)
</script>
<button id="click">click</button>
<pre id="output"></pre>
</body>
</html> I wonder if this was even tested before discussing the feature but I am not sure this is what the feature request was about ... if that's the case, I think we can resolve this discussion. /cc @ntoll and @mchilvers just as FYI |
Beta Was this translation helpful? Give feedback.
-
the PyScript preview that's going to be released is:
Everything seems fine including |
Beta Was this translation helpful? Give feedback.
-
Is it a good QoL idea to add an async version of the when decorator? It would allow one to decorate async functions the same way they would decorate normal ones.
Beta Was this translation helpful? Give feedback.
All reactions