-
There was a type checking regression in v0.28.0 that was introduced by this commit, which imported mypy doesn't like this. This will raise a type checking error in 0.28 (but not 0.27):
|
Beta Was this translation helpful? Give feedback.
Answered by
davep
Jun 21, 2023
Replies: 1 comment 3 replies
-
from __future__ import annotations
from textual.app import App, ComposeResult
from textual.widgets import Label
from textual.types import CSSPathType
class MyApp(App[None]):
def __init__(self, css_path: CSSPathType | None ) -> None:
super().__init__(css_path=css_path)
def compose(self) -> ComposeResult:
yield Label("Hello, World!")
if __name__ == "__main__":
MyApp("foo.css").run() |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
davep
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CSSPathType
now lives intextual.types
. The likes ofmypy
andpyright
seem happy with this kind of code: