justpy
justpy copied to clipboard
Unclear use of Async on Input Component page of Tutorial
The Input Component page of the Tutorial uses async def
instead of def
in several examples. But it doesn't explain why, and when I edit out the async
keyword, I get exactly the same results as when I include it. It makes no discernable difference at all.
It seems like either the examples shouldn't use async there, or some explanation should be provided.
You are right, in these examples they make no difference and should be left out. It is best to use async when the event handler is required to do some i/o and it should be done in a non-blocking way. Here is an example: https://justpy.io/tutorial/request_object/#dog-example-with-image-click