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

Type hint bug in solara.use_thread #809

Open
ntjess opened this issue Oct 9, 2024 · 2 comments
Open

Type hint bug in solara.use_thread #809

ntjess opened this issue Oct 9, 2024 · 2 comments

Comments

@ntjess
Copy link
Contributor

ntjess commented Oct 9, 2024

callback=Union[

should be:

- callback=Union[
+ callback: Union[

Otherwise type checkers complain.

@maartenbreddels
Copy link
Contributor

Oh man, this solves a long standing mystery that type inference never worked with use_thread!

Great catch.

@ntjess
Copy link
Contributor Author

ntjess commented Oct 9, 2024

Happy to help! Fun fact -- it was identifiable since pyright recently began correctly treating unions on RHS as values instead of hints: microsoft/pyright#7416 (comment)

So there was a strange interplay between union-ness and value-ness until now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants