-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Improve some of the incomplete types in tkinter.filedialog
#14311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Improve some of the incomplete types in tkinter.filedialog
#14311
Conversation
This comment has been minimized.
This comment has been minimized.
stdlib/tkinter/filedialog.pyi
Outdated
def files_select_event(self, event) -> None: ... | ||
def ok_event(self, event) -> None: ... | ||
how: str | None | ||
def go(self, dir_or_file: StrOrBytesPath = ".", pattern: str = "*", default: str = "", key: Hashable | None = None): ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like dir_or_file
gets joined with a string, so a bytes path won't work. pattern
and default
are both processed through os.path.*
functions, so a path-like can be accepted
def go(self, dir_or_file: StrOrBytesPath = ".", pattern: str = "*", default: str = "", key: Hashable | None = None): ... | |
def go(self, dir_or_file: StrPath = ".", pattern: StrPath = "*", default: StrPath = "", key: Hashable | None = None): ... |
stdlib/tkinter/filedialog.pyi
Outdated
def get_filter(self) -> tuple[str, str]: ... | ||
def get_selection(self) -> str: ... | ||
def cancel_command(self, event: Event | None = None) -> None: ... | ||
def set_filter(self, dir: StrOrBytesPath, pat: str) -> None: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def set_filter(self, dir: StrOrBytesPath, pat: str) -> None: ... | |
def set_filter(self, dir: StrPath, pat: StrPath) -> None: ... |
stdlib/tkinter/filedialog.pyi
Outdated
def get_selection(self) -> str: ... | ||
def cancel_command(self, event: Event | None = None) -> None: ... | ||
def set_filter(self, dir: StrOrBytesPath, pat: str) -> None: ... | ||
def set_selection(self, file: str) -> None: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def set_selection(self, file: str) -> None: ... | |
def set_selection(self, file: StrPath) -> None: ... |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Improved some of the incomplete types in the
tkinter.filedialog
module.