Skip to content

Commit cb2bd9e

Browse files
authored
[tkinter] Fill in remaining tkinter.filedialog defaults (#16614)
1 parent 44a9df6 commit cb2bd9e

1 file changed

Lines changed: 41 additions & 37 deletions

File tree

‎stdlib/tkinter/filedialog.pyi‎

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -80,35 +80,39 @@ def asksaveasfilename(
8080
*,
8181
confirmoverwrite: bool | None = True,
8282
defaultextension: str | None = "",
83-
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
84-
initialdir: StrOrBytesPath | None = ...,
85-
initialfile: StrOrBytesPath | None = ...,
86-
parent: Misc | None = ...,
87-
title: str | None = ...,
88-
typevariable: StringVar | str | None = ...,
83+
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] = (),
84+
initialdir: StrOrBytesPath | None = None,
85+
initialfile: StrOrBytesPath | None = None,
86+
parent: Misc | None = None,
87+
title: str | None = None,
88+
typevariable: StringVar | str | None = None,
8989
) -> str: ... # can be empty string
9090
def askopenfilename(
9191
*,
9292
defaultextension: str | None = "",
93-
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
94-
initialdir: StrOrBytesPath | None = ...,
95-
initialfile: StrOrBytesPath | None = ...,
96-
parent: Misc | None = ...,
97-
title: str | None = ...,
98-
typevariable: StringVar | str | None = ...,
93+
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] = (),
94+
initialdir: StrOrBytesPath | None = None,
95+
initialfile: StrOrBytesPath | None = None,
96+
parent: Misc | None = None,
97+
title: str | None = None,
98+
typevariable: StringVar | str | None = None,
9999
) -> str: ... # can be empty string
100100
def askopenfilenames(
101101
*,
102102
defaultextension: str | None = "",
103-
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
104-
initialdir: StrOrBytesPath | None = ...,
105-
initialfile: StrOrBytesPath | None = ...,
106-
parent: Misc | None = ...,
107-
title: str | None = ...,
108-
typevariable: StringVar | str | None = ...,
103+
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] = (),
104+
initialdir: StrOrBytesPath | None = None,
105+
initialfile: StrOrBytesPath | None = None,
106+
parent: Misc | None = None,
107+
title: str | None = None,
108+
typevariable: StringVar | str | None = None,
109109
) -> Literal[""] | tuple[str, ...]: ...
110110
def askdirectory(
111-
*, initialdir: StrOrBytesPath | None = ..., mustexist: bool | None = False, parent: Misc | None = ..., title: str | None = ...
111+
*,
112+
initialdir: StrOrBytesPath | None = None,
113+
mustexist: bool | None = False,
114+
parent: Misc | None = None,
115+
title: str | None = None,
112116
) -> str: ... # can be empty string
113117

114118
# TODO: If someone actually uses these, overload to have the actual return type of open(..., mode)
@@ -117,33 +121,33 @@ def asksaveasfile(
117121
*,
118122
confirmoverwrite: bool | None = True,
119123
defaultextension: str | None = "",
120-
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
121-
initialdir: StrOrBytesPath | None = ...,
122-
initialfile: StrOrBytesPath | None = ...,
123-
parent: Misc | None = ...,
124-
title: str | None = ...,
125-
typevariable: StringVar | str | None = ...,
124+
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] = (),
125+
initialdir: StrOrBytesPath | None = None,
126+
initialfile: StrOrBytesPath | None = None,
127+
parent: Misc | None = None,
128+
title: str | None = None,
129+
typevariable: StringVar | str | None = None,
126130
) -> IO[Incomplete] | None: ...
127131
def askopenfile(
128132
mode: str = "r",
129133
*,
130134
defaultextension: str | None = "",
131-
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
132-
initialdir: StrOrBytesPath | None = ...,
133-
initialfile: StrOrBytesPath | None = ...,
134-
parent: Misc | None = ...,
135-
title: str | None = ...,
136-
typevariable: StringVar | str | None = ...,
135+
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] = (),
136+
initialdir: StrOrBytesPath | None = None,
137+
initialfile: StrOrBytesPath | None = None,
138+
parent: Misc | None = None,
139+
title: str | None = None,
140+
typevariable: StringVar | str | None = None,
137141
) -> IO[Incomplete] | None: ...
138142
def askopenfiles(
139143
mode: str = "r",
140144
*,
141145
defaultextension: str | None = "",
142-
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ...,
143-
initialdir: StrOrBytesPath | None = ...,
144-
initialfile: StrOrBytesPath | None = ...,
145-
parent: Misc | None = ...,
146-
title: str | None = ...,
147-
typevariable: StringVar | str | None = ...,
146+
filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] = (),
147+
initialdir: StrOrBytesPath | None = None,
148+
initialfile: StrOrBytesPath | None = None,
149+
parent: Misc | None = None,
150+
title: str | None = None,
151+
typevariable: StringVar | str | None = None,
148152
) -> tuple[IO[Incomplete], ...]: ... # can be empty tuple
149153
def test() -> None: ...

0 commit comments

Comments
 (0)