Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a warning if there's no final yield in an event handler generator function #515

Closed
wwwillchen opened this issue Jun 24, 2024 · 1 comment
Labels
product excellence Improving developer experience, UI and errors

Comments

@wwwillchen
Copy link
Collaborator

If you have an event handler like the following:

def on_click(e):
   do_work(e.key)
   yield
   do_more_work()

There's actually a bug where you should actually put a yield after do_more_work. Either: do_more_work doesn't get executed or it does get executed and you wait a while before the results are ready (not sure why the latter case occurs for on_load)

@wwwillchen wwwillchen added the product excellence Improving developer experience, UI and errors label Jun 24, 2024
@wwwillchen
Copy link
Collaborator Author

It's difficult to do this programmatically (would require parsing AST), but we added docs on this point specifically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product excellence Improving developer experience, UI and errors
Projects
None yet
Development

No branches or pull requests

1 participant