Skip to content

Commit

Permalink
tkinter: add info_patchlevel for 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra authored May 7, 2022
1 parent e8b3619 commit caa4250
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion stdlib/tkinter/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ from enum import Enum
from tkinter.constants import *
from tkinter.font import _FontDescription
from types import TracebackType
from typing import Any, Generic, Protocol, TypeVar, Union, overload
from typing import Any, Generic, NamedTuple, Protocol, TypeVar, Union, overload
from typing_extensions import Literal, TypeAlias, TypedDict

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

if sys.version_info >= (3, 11):
class _VersionInfoType(NamedTuple):
major: int
minor: int
micro: int
releaselevel: str
serial: int

class EventType(str, Enum):
Activate: str
ButtonPress: str
Expand Down Expand Up @@ -377,6 +385,8 @@ class Misc:
def lower(self, belowThis: Any | None = ...) -> None: ...
def tkraise(self, aboveThis: Any | None = ...) -> None: ...
lift = tkraise
if sys.version_info >= (3, 11):
def info_patchlevel(self) -> VersionInfoType: ...
def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = ...) -> int: ...
def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = ...) -> str: ...
def winfo_cells(self) -> int: ...
Expand Down

0 comments on commit caa4250

Please sign in to comment.