Use PEP 604 syntax wherever possible, part II (#7514)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Alex WaygoodandJelle Zijlstra authored and GitHub committed 2022-03-19 14:27:35 +00:00
1 parent 340c6c97ed
commit 1acc8f3bd6
55 files changed
+116 -141

No files matched your search

+8 -12
View File
@@ -1,7 +1,7 @@
import _tkinter
import sys
import tkinter
from typing import Any, Union, overload
from typing import Any, overload
from typing_extensions import Literal, TypedDict
if sys.version_info >= (3, 9):
@@ -12,17 +12,13 @@ ROMAN: Literal["roman"]
BOLD: Literal["bold"]
ITALIC: Literal["italic"]
_FontDescription = Union[
# "Helvetica 12"
str,
# A font object constructed in Python
Font,
# ("Helvetica", 12, BOLD)
list[Any],
tuple[Any, ...],
# A font object constructed in Tcl
_tkinter.Tcl_Obj,
]
_FontDescription = (
str # "Helvetica 12"
| Font # A font object constructed in Python
| list[Any] # ("Helvetica", 12, BOLD)
| tuple[Any, ...]
| _tkinter.Tcl_Obj # A font object constructed in Tcl
)
class _FontDict(TypedDict):
family: str