change return types to deal with upper bounds #2342
Answered
by
davep
boanergies
asked this question in
Q&A
-
Have you checked closed issues? https://github.com/Textualize/textual/issues?q=is%3Aissue+is%3Aclosed When using code like the example below and trying to run mypy on it
you will then get this error:
This is because the return type for It's probably not an immediate issue but it will make using mypy in textual projects better |
Beta Was this translation helpful? Give feedback.
Answered by
davep
Apr 20, 2023
Replies: 1 comment 2 replies
-
This would be the perfect time to use the option = self.query_one("#update", OptionList) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
davep
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This would be the perfect time to use the
expect_type
parameter ofquery_one
, for example: