Skip to content

Commit 2fc719d

Browse files
tkinter: add info_patchlevel for 3.11 (#7794)
1 parent 963b8aa commit 2fc719d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

stdlib/tkinter/__init__.pyi

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ from enum import Enum
66
from tkinter.constants import *
77
from tkinter.font import _FontDescription
88
from types import TracebackType
9-
from typing import Any, Generic, Protocol, TypeVar, Union, overload
9+
from typing import Any, Generic, NamedTuple, Protocol, TypeVar, Union, overload
1010
from typing_extensions import Literal, TypeAlias, TypedDict
1111

1212
if sys.version_info >= (3, 9):
@@ -198,6 +198,14 @@ _ScreenUnits: TypeAlias = str | float # Often the right type instead of int. Ma
198198
_XYScrollCommand: TypeAlias = str | Callable[[float, float], Any] # -xscrollcommand and -yscrollcommand in 'options' manual page
199199
_TakeFocusValue: TypeAlias = Union[int, Literal[""], Callable[[str], bool | None]] # -takefocus in manual page named 'options'
200200

201+
if sys.version_info >= (3, 11):
202+
class _VersionInfoType(NamedTuple):
203+
major: int
204+
minor: int
205+
micro: int
206+
releaselevel: str
207+
serial: int
208+
201209
class EventType(str, Enum):
202210
Activate: str
203211
ButtonPress: str
@@ -377,6 +385,9 @@ class Misc:
377385
def lower(self, belowThis: Any | None = ...) -> None: ...
378386
def tkraise(self, aboveThis: Any | None = ...) -> None: ...
379387
lift = tkraise
388+
if sys.version_info >= (3, 11):
389+
def info_patchlevel(self) -> _VersionInfoType: ...
390+
380391
def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = ...) -> int: ...
381392
def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = ...) -> str: ...
382393
def winfo_cells(self) -> int: ...

0 commit comments

Comments
 (0)