diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 8f2a73dc6..788b34694 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -13,7 +13,6 @@ multiprocessing.managers._BaseDictProxy.fromkeys multiprocessing.process.BaseProcess.interrupt multiprocessing.synchronize.SemLock.locked tarfile.TarFile.zstopen -tkinter.Event.__class_getitem__ # ========================= # New errors in Python 3.14 diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 2a4657f86..db0e34d73 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -4,7 +4,7 @@ from _typeshed import Incomplete, MaybeNone, StrOrBytesPath from collections.abc import Callable, Iterable, Mapping, Sequence from tkinter.constants import * from tkinter.font import _FontDescription -from types import TracebackType +from types import GenericAlias, TracebackType from typing import Any, ClassVar, Generic, Literal, NamedTuple, Protocol, TypedDict, TypeVar, overload, type_check_only from typing_extensions import TypeAlias, TypeVarTuple, Unpack, deprecated @@ -308,6 +308,8 @@ class Event(Generic[_W_co]): type: EventType widget: _W_co delta: int + if sys.version_info >= (3, 14): + def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... def NoDefaultRoot() -> None: ...