Replies: 2 comments 3 replies
|
Sorry, forgot to include the link to the commit main...matmaer:textual:fix/message-pump-app-unknown-type |
0 replies
|
I have another problem with typing here because class MyApp(App):
def something_useful(self):
print("SO useful")When I try to use this function in a class MyWidget(Static)
def make_something_useful_happen(self):
self.app.something_useful() # <- Cannot access attribute "something_useful" for class "App[Unknown]" |
3 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.
In
message_pump.py, theTYPE_CHECKINGbranch defines:But the
elsebranch (the actual runtime property) declares:This causes a "partially unknown type" warning on every
self.appaccess in my dev env.The fix is a one-line change to make both branches consistent:
I believe this should have zero runtime impact.
I have a PR ready if this looks reasonable, please let me know so I can add the link to the discussion in the PR, as the template instructs me to include a link. I didn't want to open an issue as it's purely about type hinting.
All reactions