Skip to content

Commit 2d3edbd

Browse files
srittauJelleZijlstra
authored andcommitted
Slightly improve annotation of tkinter.Tk (python#2498)
Closes: python#1767
1 parent 94a1b09 commit 2d3edbd

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

‎stdlib/3/tkinter/__init__.pyi‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import Any
1+
from types import TracebackType
2+
from typing import Any, Optional, Dict, Callable, Type
23
from tkinter.constants import * # noqa: F403
34

45
TclError = ... # type: Any
@@ -275,15 +276,16 @@ class Wm:
275276
withdraw = ... # type: Any
276277

277278
class Tk(Misc, Wm):
278-
master = ... # type: Any
279-
children = ... # type: Any
280-
tk = ... # type: Any
281-
def __init__(self, screenName=None, baseName=None, className: str = ..., useTk=1, sync=0, use=None) -> None: ...
282-
def loadtk(self): ...
283-
def destroy(self): ...
284-
def readprofile(self, baseName, className): ...
285-
def report_callback_exception(self, exc, val, tb): ...
286-
def __getattr__(self, attr): ...
279+
master: Optional[Any]
280+
children: Dict[str, Any]
281+
tk: Any
282+
def __init__(self, screenName: Optional[str] = ..., baseName: Optional[str] = ..., className: str = ..., useTk: bool = ...,
283+
sync: bool = ..., use: Optional[str] = ...) -> None: ...
284+
def loadtk(self) -> None: ...
285+
def destroy(self) -> None: ...
286+
def readprofile(self, baseName: str, className: str) -> None: ...
287+
report_callback_exception: Callable[[Type[BaseException], BaseException, TracebackType], Any]
288+
def __getattr__(self, attr: str) -> Any: ...
287289

288290
def Tcl(screenName=None, baseName=None, className: str = ..., useTk=0): ...
289291

0 commit comments

Comments
 (0)