reply_text and making mypy happy #5073
Unanswered
BlankAdventure
asked this question in
Q&A
Replies: 1 comment
-
|
Hi. please have a look at #3332 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Consider a pretty standard command callback function:
mypywill complain about this as message can vary depending on different calling contexts:error: Item "None" of "Message | None" has no attribute "reply_text" [union-attr]To keep
mypyhappy I've taken to using this pattern in all my callbacks:But its kind of annoying repeating this everywhere, and moreoever, none of the code examples seem bother with this. I know
mypyisn't the be-all-end-all, but I'm curious about this discrepancy.Beta Was this translation helpful? Give feedback.
All reactions