8000 tkinter: add info_patchlevel for 3.11 · python/typeshed@caa4250 · GitHub
[go: up one dir, main page]

Skip to content

Commit caa4250

Browse files
tkinter: add info_patchlevel for 3.11
python/cpython#91829
1 parent e8b3619 commit caa4250

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

stdlib/tkinter/__init__.pyi

Lines changed: 11 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,8 @@ 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: ...
380390
def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = ...) -> int: ...
381391
def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = ...) -> str: ...
382392
def winfo_cells(self) -> int: ...

0 commit comments

Comments
 (0)
0