Skip to content
Discussion options

You must be logged in to vote

I would expect mypy to perhaps give a warning about inheriting from Screen with more recent versions of Textual as there is a new feature -- still to be properly documented -- for typing a screen and being able to return a result from a screen when it's dismissed. See #2321 for more details on that.

If you're not intending to return a result from your modal screen you can change the code you show above to be like this:

class ModalScreen(Screen[None]):
    ...

As a slight aside to this, you might want to note that ModalScreen is now a type in Textual.

More generally though, I'm not clear on why you'd be seeing the warnings you're showing there. I'm running mypy v1.2.0 here and testing it o…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@PabloLec
Comment options

@davep
Comment options

Answer selected by PabloLec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2428 on April 29, 2023 07:50.