From 5b03ad18cca9d8a2a1338d5a0c5b86a73d97b8bb Mon Sep 17 00:00:00 2001 From: Akuli Date: Sat, 16 Oct 2021 16:41:52 +0000 Subject: [PATCH] tkinter.ttk.Treeview: more Literal[""] (#6182) --- stdlib/tkinter/ttk.pyi | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stdlib/tkinter/ttk.pyi b/stdlib/tkinter/ttk.pyi index 438baf89b..9ee5b5c35 100644 --- a/stdlib/tkinter/ttk.pyi +++ b/stdlib/tkinter/ttk.pyi @@ -888,10 +888,10 @@ if sys.version_info >= (3, 7): class _TreeviewItemDict(TypedDict): text: str - image: Literal[""] | list[str] # no idea why it's wrapped in list - values: list[Any] + image: list[str] | Literal[""] # no idea why it's wrapped in list + values: list[Any] | Literal[""] open: bool # actually 0 or 1 - tags: list[str] + tags: list[str] | Literal[""] class _TreeviewTagDict(TypedDict): # There is also 'text' and 'anchor', but they don't seem to do anything, using them is likely a bug @@ -1034,13 +1034,13 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def item(self, item: str, option: Literal["text"]) -> str: ... @overload - def item(self, item: str, option: Literal["image"]) -> Literal[""] | tuple[str]: ... + def item(self, item: str, option: Literal["image"]) -> tuple[str] | Literal[""]: ... @overload - def item(self, item: str, option: Literal["values"]) -> Literal[""] | Tuple[Any, ...]: ... + def item(self, item: str, option: Literal["values"]) -> Tuple[Any, ...] | Literal[""]: ... @overload def item(self, item: str, option: Literal["open"]) -> bool: ... # actually 0 or 1 @overload - def item(self, item: str, option: Literal["tags"]) -> Literal[""] | Tuple[str, ...]: ... + def item(self, item: str, option: Literal["tags"]) -> Tuple[str, ...] | Literal[""]: ... @overload def item(self, item: str, option: str) -> Any: ... @overload @@ -1051,7 +1051,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): *, text: str = ..., image: tkinter._ImageSpec = ..., - values: tkinter._TkinterSequence[Any] = ..., + values: tkinter._TkinterSequence[Any] | Literal[""] = ..., open: bool = ..., tags: str | tkinter._TkinterSequence[str] = ..., ) -> _TreeviewItemDict | None: ...