Skip to content

Commit 97d0c89

Browse files
Improve some of the incomplete types in tkinter.filedialog (#14311)
1 parent 85b0663 commit 97d0c89

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

stdlib/tkinter/filedialog.pyi

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from _typeshed import Incomplete, StrOrBytesPath
2-
from collections.abc import Iterable
3-
from tkinter import Button, Entry, Frame, Listbox, Misc, Scrollbar, StringVar, Toplevel, commondialog
1+
from _typeshed import Incomplete, StrOrBytesPath, StrPath
2+
from collections.abc import Hashable, Iterable
3+
from tkinter import Button, Entry, Event, Frame, Listbox, Misc, Scrollbar, StringVar, Toplevel, commondialog
44
from typing import IO, ClassVar, Literal
55

66
__all__ = [
@@ -19,12 +19,12 @@ __all__ = [
1919
"askdirectory",
2020
]
2121

22-
dialogstates: dict[Incomplete, tuple[Incomplete, Incomplete]]
22+
dialogstates: dict[Hashable, tuple[str, str]]
2323

2424
class FileDialog:
2525
title: str
26-
master: Incomplete
27-
directory: Incomplete | None
26+
master: Misc
27+
directory: str | None
2828
top: Toplevel
2929
botframe: Frame
3030
selection: Entry
@@ -38,23 +38,23 @@ class FileDialog:
3838
filter_button: Button
3939
cancel_button: Button
4040
def __init__(
41-
self, master, title=None
41+
self, master: Misc, title: str | None = None
4242
) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either
43-
how: Incomplete | None
44-
def go(self, dir_or_file=".", pattern: str = "*", default: str = "", key=None): ...
45-
def quit(self, how=None) -> None: ...
46-
def dirs_double_event(self, event) -> None: ...
47-
def dirs_select_event(self, event) -> None: ...
48-
def files_double_event(self, event) -> None: ...
49-
def files_select_event(self, event) -> None: ...
50-
def ok_event(self, event) -> None: ...
43+
how: str | None
44+
def go(self, dir_or_file: StrPath = ".", pattern: StrPath = "*", default: StrPath = "", key: Hashable | None = None): ...
45+
def quit(self, how: str | None = None) -> None: ...
46+
def dirs_double_event(self, event: Event) -> None: ...
47+
def dirs_select_event(self, event: Event) -> None: ...
48+
def files_double_event(self, event: Event) -> None: ...
49+
def files_select_event(self, event: Event) -> None: ...
50+
def ok_event(self, event: Event) -> None: ...
5151
def ok_command(self) -> None: ...
52-
def filter_command(self, event=None) -> None: ...
53-
def get_filter(self): ...
54-
def get_selection(self): ...
55-
def cancel_command(self, event=None) -> None: ...
56-
def set_filter(self, dir, pat) -> None: ...
57-
def set_selection(self, file) -> None: ...
52+
def filter_command(self, event: Event | None = None) -> None: ...
53+
def get_filter(self) -> tuple[str, str]: ...
54+
def get_selection(self) -> str: ...
55+
def cancel_command(self, event: Event | None = None) -> None: ...
56+
def set_filter(self, dir: StrPath, pat: StrPath) -> None: ...
57+
def set_selection(self, file: StrPath) -> None: ...
5858

5959
class LoadFileDialog(FileDialog):
6060
title: str

0 commit comments

Comments
 (0)