From 6976a8b43708ed3363a27dc8c8fc513a0d1dc075 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sat, 30 May 2026 02:17:34 +0300 Subject: [PATCH 1/2] Add comments to tkinter.Wm.wm_attributes overloads --- stdlib/tkinter/__init__.pyi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 9f1c346cdc19..865668b63504 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -766,6 +766,8 @@ class Wm: ) -> tuple[int, int, int, int] | None: ... aspect = wm_aspect + + # wm_attributes: Get all attributes if sys.version_info >= (3, 13): @overload def wm_attributes(self, *, return_python_dict: Literal[False] = False) -> tuple[Any, ...]: ... @@ -775,6 +777,7 @@ class Wm: @overload def wm_attributes(self) -> tuple[Any, ...]: ... + # wm_attributes: Get one attribute (old variant using string that starts with "-") @overload def wm_attributes(self, option: Literal["-alpha"], /) -> float: ... @overload @@ -805,7 +808,9 @@ class Wm: def wm_attributes(self, option: Literal["-zoomed"], /) -> bool: ... @overload def wm_attributes(self, option: Literal["-type"], /) -> str: ... + if sys.version_info >= (3, 13): + # wm_attributes: Get one attribute (new variant without "-") @overload def wm_attributes(self, option: Literal["alpha"], /) -> float: ... @overload @@ -837,6 +842,7 @@ class Wm: @overload def wm_attributes(self, option: Literal["type"], /) -> str: ... + # wm_attributes: Set an attribute (old variant using string that starts with "-") @overload def wm_attributes(self, option: str, /): ... @overload @@ -868,9 +874,11 @@ class Wm: @overload def wm_attributes(self, option: Literal["-type"], value: str, /) -> Literal[""]: ... + # wm_attributes: Set multiple attributes (old variant using strings that start with "-") @overload def wm_attributes(self, option: str, value, /, *__other_option_value_pairs: Any) -> Literal[""]: ... + # wm_attributes: Set an attribute (new variant with kwarg instead of string) if sys.version_info >= (3, 13): if sys.platform == "darwin": @overload From 86fbddc82a8e5d0eee172fc0d69477b7a75e24fa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 23:23:41 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/tkinter/__init__.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 865668b63504..7c7e3cc29656 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -808,7 +808,6 @@ class Wm: def wm_attributes(self, option: Literal["-zoomed"], /) -> bool: ... @overload def wm_attributes(self, option: Literal["-type"], /) -> str: ... - if sys.version_info >= (3, 13): # wm_attributes: Get one attribute (new variant without "-") @overload