Skip to content

Commit

Permalink
lift ColorType outside of TYPE_CHECKING
Browse files Browse the repository at this point in the history
we'll need this in the next patch to make sure the type checking all
compiles and works.

Signed-off-by: Tycho Andersen <[email protected]>
  • Loading branch information
tych0 committed Mar 26, 2024
1 parent 04354d5 commit 7bb9ded
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions libqtile/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@
from pathlib import Path
from random import randint
from shutil import which
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from typing import Any, Callable, Coroutine, TypeVar, Union

ColorType = Union[str, tuple[int, int, int], tuple[int, int, int, float]]
ColorsType = Union[ColorType, list[ColorType]]

T = TypeVar("T")
from typing import TYPE_CHECKING, Union

try:
from dbus_next import AuthError, Message, Variant
Expand All @@ -52,6 +44,14 @@

from libqtile.log_utils import logger

ColorType = Union[str, tuple[int, int, int], tuple[int, int, int, float]]
if TYPE_CHECKING:
from typing import Any, Callable, Coroutine, TypeVar

ColorsType = Union[ColorType, list[ColorType]]

T = TypeVar("T")

dbus_bus_connections = set()

# Create a list to collect references to tasks so they're not garbage collected
Expand Down

0 comments on commit 7bb9ded

Please sign in to comment.