From 0cff9be9d99e5ce9a4a60d26a656f783a21e73c7 Mon Sep 17 00:00:00 2001 From: Stephen Morton Date: Sun, 6 Oct 2024 16:58:18 -0700 Subject: [PATCH] add tkinter.tix.Form to the bases of tkinter.Widget At runtime, it's added directly to Widget.__bases__ dynamically, rather than being an actual base. --- stdlib/tkinter/__init__.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 4d25a04f8eb7..d3d7020f27e2 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -2,6 +2,7 @@ import _tkinter import sys from _typeshed import Incomplete, StrEnum, StrOrBytesPath from collections.abc import Callable, Iterable, Mapping, Sequence +from tkinter import tix from tkinter.constants import * from tkinter.font import _FontDescription from types import TracebackType @@ -920,7 +921,8 @@ class BaseWidget(Misc): def destroy(self) -> None: ... # This class represents any widget except Toplevel or Tk. -class Widget(BaseWidget, Pack, Place, Grid): +# At runtime, tix.Form is added to __bases__ dynamically. +class Widget(BaseWidget, Pack, Place, Grid, tix.Form): # Allow bind callbacks to take e.g. Event[Label] instead of Event[Misc]. # Tk and Toplevel get notified for their child widgets' events, but other # widgets don't.