Add many missing tkinter type annotations (#6002)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Screwtapello
2021-09-12 18:42:12 +10:00
committed by GitHub
parent 8576b344b8
commit 4c6e98ed0c
4 changed files with 92 additions and 33 deletions

View File

@@ -1,3 +1,4 @@
import _tkinter
import sys
import tkinter
from typing import Any, Tuple, Union, overload
@@ -8,8 +9,16 @@ ROMAN: Literal["roman"]
BOLD: Literal["bold"]
ITALIC: Literal["italic"]
# Can contain e.g. nested sequences ('FONT DESCRIPTIONS' in font man page)
_FontDescription = Union[str, Font, tkinter._TkinterSequence[Any]]
_FontDescription = Union[
# "Helvetica 12"
str,
# A font object constructed in Python
Font,
# ("Helvetica", 12, BOLD)
tkinter._TkinterSequence[Any],
# A font object constructed in Tcl
_tkinter.Tcl_Obj,
]
class _FontDict(TypedDict):
family: str