Skip to content

Commit 3157273

Browse files
Allow any number of trailing font options in tkinter font description (#13240)
1 parent bd728fb commit 3157273

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

stdlib/tkinter/font.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import itertools
33
import sys
44
import tkinter
55
from typing import Any, ClassVar, Final, Literal, TypedDict, overload
6-
from typing_extensions import TypeAlias
6+
from typing_extensions import TypeAlias, Unpack
77

88
if 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

Comments
 (0)