Use PEP 585 syntax wherever possible (#6717)

This commit is contained in:
Alex Waygood
2021-12-28 10:31:43 +00:00
committed by GitHub
parent e6cb341d94
commit 8d5d2520ac
237 changed files with 966 additions and 1069 deletions

View File

@@ -1,6 +1,6 @@
from _typeshed import StrOrBytesPath
from tkinter import Button, Entry, Frame, Listbox, Misc, Scrollbar, StringVar, Toplevel, commondialog
from typing import IO, Any, ClassVar, Iterable, Tuple
from typing import IO, Any, ClassVar, Iterable
from typing_extensions import Literal
dialogstates: dict[Any, tuple[Any, Any]]
@@ -64,7 +64,7 @@ def asksaveasfilename(
*,
confirmoverwrite: bool | None = ...,
defaultextension: str | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | Tuple[str, ...]]] | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
initialdir: StrOrBytesPath | None = ...,
initialfile: StrOrBytesPath | None = ...,
parent: Misc | None = ...,
@@ -74,7 +74,7 @@ def asksaveasfilename(
def askopenfilename(
*,
defaultextension: str | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | Tuple[str, ...]]] | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
initialdir: StrOrBytesPath | None = ...,
initialfile: StrOrBytesPath | None = ...,
parent: Misc | None = ...,
@@ -84,13 +84,13 @@ def askopenfilename(
def askopenfilenames(
*,
defaultextension: str | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | Tuple[str, ...]]] | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
initialdir: StrOrBytesPath | None = ...,
initialfile: StrOrBytesPath | None = ...,
parent: Misc | None = ...,
title: str | None = ...,
typevariable: StringVar | str | None = ...,
) -> Literal[""] | Tuple[str, ...]: ...
) -> Literal[""] | tuple[str, ...]: ...
def askdirectory(
*, initialdir: StrOrBytesPath | None = ..., mustexist: bool | None = ..., parent: Misc | None = ..., title: str | None = ...
) -> str: ... # can be empty string
@@ -101,7 +101,7 @@ def asksaveasfile(
*,
confirmoverwrite: bool | None = ...,
defaultextension: str | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | Tuple[str, ...]]] | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
initialdir: StrOrBytesPath | None = ...,
initialfile: StrOrBytesPath | None = ...,
parent: Misc | None = ...,
@@ -112,7 +112,7 @@ def askopenfile(
mode: str = ...,
*,
defaultextension: str | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | Tuple[str, ...]]] | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
initialdir: StrOrBytesPath | None = ...,
initialfile: StrOrBytesPath | None = ...,
parent: Misc | None = ...,
@@ -123,11 +123,11 @@ def askopenfiles(
mode: str = ...,
*,
defaultextension: str | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | Tuple[str, ...]]] | None = ...,
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
initialdir: StrOrBytesPath | None = ...,
initialfile: StrOrBytesPath | None = ...,
parent: Misc | None = ...,
title: str | None = ...,
typevariable: StringVar | str | None = ...,
) -> Tuple[IO[Any], ...]: ... # can be empty tuple
) -> tuple[IO[Any], ...]: ... # can be empty tuple
def test() -> None: ...