@@ -3,7 +3,7 @@ import itertools
33import sys
44import tkinter
55from typing import Any , ClassVar , Final , Literal , TypedDict , overload
6- from typing_extensions import TypeAlias
6+ from typing_extensions import TypeAlias , Unpack
77
88if sys .version_info >= (3 , 9 ):
99 __all__ = ["NORMAL" , "ROMAN" , "BOLD" , "ITALIC" , "nametofont" , "Font" , "families" , "names" ]
@@ -18,9 +18,9 @@ _FontDescription: TypeAlias = (
1818 | Font # A font object constructed in Python
1919 | list [Any ] # ["Helvetica", 12, BOLD]
2020 | tuple [str ] # ("Liberation Sans",) needs wrapping in tuple/list to handle spaces
21- | tuple [ str , int ] # ("Liberation Sans", 12)
22- | tuple [str , int , str ] # ("Liberation Sans", 12, "bold")
23- | tuple [str , int , list [str ] | tuple [str , ...]] # e.g. bold and italic
21+ # ("Liberation Sans", 12) or ("Liberation Sans", 12, "bold", "italic", "underline" )
22+ | tuple [str , int , Unpack [ tuple [ str , ...]]] # Any number of trailing options is permitted
23+ | tuple [str , int , list [str ] | tuple [str , ...]] # Options can also be passed as list/tuple
2424 | _tkinter .Tcl_Obj # A font object constructed in Tcl
2525)
2626
0 commit comments