From f2d96e6e62afc2f12fb2d0abcba659f366bde92f Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Tue, 7 Feb 2023 12:01:18 +0000 Subject: [PATCH] or None --- src/textual/_types.py | 3 +-- src/textual/css/_help_text.py | 7 +++++-- src/textual/css/constants.py | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/textual/_types.py b/src/textual/_types.py index 4881cbab8..5db2e27f3 100644 --- a/src/textual/_types.py +++ b/src/textual/_types.py @@ -1,8 +1,7 @@ from typing import TYPE_CHECKING, Awaitable, Callable, List, Union -from typing_extensions import Protocol - from rich.segment import Segment +from typing_extensions import Protocol if TYPE_CHECKING: from .message import Message diff --git a/src/textual/css/_help_text.py b/src/textual/css/_help_text.py index 0e57fdccf..e0f3b60ed 100644 --- a/src/textual/css/_help_text.py +++ b/src/textual/css/_help_text.py @@ -126,7 +126,10 @@ def _spacing_examples(property_name: str) -> ContextSpecificBullets: def property_invalid_value_help_text( - property_name: str, context: StylingContext, *, suggested_property_name: str = None + property_name: str, + context: StylingContext, + *, + suggested_property_name: str | None = None, ) -> HelpText: """Help text to show when the user supplies an invalid value for CSS property property. @@ -301,7 +304,7 @@ def color_property_help_text( property_name: str, context: StylingContext, *, - error: Exception = None, + error: Exception | None = None, ) -> HelpText: """Help text to show when the user supplies an invalid value for a color property. For example, an unparseable color string. diff --git a/src/textual/css/constants.py b/src/textual/css/constants.py index c9598ff32..c3c073940 100644 --- a/src/textual/css/constants.py +++ b/src/textual/css/constants.py @@ -5,7 +5,6 @@ from ..geometry import Spacing if typing.TYPE_CHECKING: from typing_extensions import Final - from .types import EdgeType VALID_VISIBILITY: Final = {"visible", "hidden"} VALID_DISPLAY: Final = {"block", "none"}