-
Notifications
You must be signed in to change notification settings - Fork 823
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
Fix TabbedContent
type errors
#4243
Conversation
@@ -430,13 +432,19 @@ def add_pane( | |||
pane = self._set_id(pane, tabs.tab_count + 1) | |||
assert pane.id is not None | |||
pane.display = False | |||
|
|||
async def _add_part(awaitable: AwaitComplete | AwaitMount) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right. If you need to wrap those awaitables in a coroutine, it suggests that maybe AwaitComplete
is type incorrectly.
Maybe AwaitComplete
needs to accept an Awaitable
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the code was wrong anyway, you mean, and the hint tweak is moot? If so I'll close this. Was just a passing tidy-up anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be correct, but the typing error stems from AwaitComplete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I'll close this and flag up that AwaitComplete might need a wee bit more tinkering.
), | ||
self.get_child_by_type(ContentSwitcher).mount(pane), | ||
_add_part(self.get_child_by_type(ContentSwitcher).mount(pane)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually seems like a flaw. The AwaitCompete
class runs its awaitables concurrently. This looks like something that should run in serial.
Closing in favor of #4255 |
Beat me to it. Thanks. |
Following on from #4234, fixes a couple of type errors in
TabbedContent
relating to adding and removing panes.