Skip to content
Discussion options

You must be logged in to vote

CSSPathType now lives in textual.types. The likes of mypy and pyright seem happy with this kind of code:

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()

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tconbeer
Comment options

@davep
Comment options

@willmcgugan
Comment options

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

This discussion was converted from issue #2812 on June 21, 2023 06:40.