From c8db1d6cfe55b8dd1627682f1c23a8476c8267c2 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Tue, 29 Oct 2024 11:45:42 +0000 Subject: [PATCH] typing --- src/textual/css/stylesheet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/textual/css/stylesheet.py b/src/textual/css/stylesheet.py index 91076020db..dd321a2fa4 100644 --- a/src/textual/css/stylesheet.py +++ b/src/textual/css/stylesheet.py @@ -5,7 +5,7 @@ from itertools import chain from operator import itemgetter from pathlib import Path, PurePath -from typing import Iterable, NamedTuple, Sequence, cast +from typing import Final, Iterable, NamedTuple, Sequence, cast import rich.repr from rich.console import Console, ConsoleOptions, RenderableType, RenderResult @@ -435,7 +435,7 @@ def _check_rule( # pseudo classes which iterate over multiple nodes # These shouldn't be used in a cache key - EXCLUDE_PSEUDO_CLASSES_FROM_CACHE = { + _EXCLUDE_PSEUDO_CLASSES_FROM_CACHE: Final[set[str]] = { "first-of-type", "last-of_type", "odd", @@ -488,7 +488,7 @@ def apply( cache_key: tuple | None = None if cache is not None and all_pseudo_classes.isdisjoint( - self.EXCLUDE_PSEUDO_CLASSES_FROM_CACHE + self._EXCLUDE_PSEUDO_CLASSES_FROM_CACHE ): cache_key = ( node._parent,