From 4a02d4bed9c571e759aa164148dd05174f4c98c2 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Thu, 13 Apr 2023 21:48:39 -0700 Subject: [PATCH] gui: improve type hinting for ShowVar.state() --- daemon/core/gui/graph/manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/core/gui/graph/manager.py b/daemon/core/gui/graph/manager.py index a0f60754..b2745f5c 100644 --- a/daemon/core/gui/graph/manager.py +++ b/daemon/core/gui/graph/manager.py @@ -4,7 +4,7 @@ import tkinter as tk from collections.abc import ValuesView from copy import deepcopy from tkinter import BooleanVar, messagebox, ttk -from typing import TYPE_CHECKING, Any, Optional +from typing import TYPE_CHECKING, Any, Literal, Optional from core.api.grpc.wrappers import Link, LinkType, Node, Session, ThroughputsEvent from core.gui import nodeutils as nutils @@ -35,7 +35,7 @@ class ShowVar(BooleanVar): self.manager: "CanvasManager" = manager self.tag: str = tag - def state(self) -> str: + def state(self) -> Literal["normal", "hidden"]: return tk.NORMAL if self.get() else tk.HIDDEN def click_handler(self) -> None: