Skip to content

gh-127930: use explicit imports in tkinter.simpledialog #127931

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tungol
Copy link
Contributor

@tungol tungol commented Dec 13, 2024

simpledialog was overlooked when all the other tkinter submodules were updated to use explicit imports in #14864. This MR fixes that.

This is relevant to typeshed, where stubtest detects the extra constants imported into tkinter.simpledialog and emits a warning that they're not present in the stubs. Star imports in the stdlib usually indicate an intention to re-export.

I don't think this is user-facing enough to need a NEWS entry, but I'm happy to add one if anyone thinks otherwise.

@tungol tungol changed the title gh: 127930: use explicit imports in tkinter.simpledialog gh-127930: use explicit imports in tkinter.simpledialog Dec 13, 2024
@picnixz
Copy link
Member

picnixz commented Dec 14, 2024

I hope, no one does from tkinter.simpledialog import SOMETHING_THAT_WAS_STAR_IMPORTED or from tkinter.simpledialog import *. Otherwise, LGTM. What you can do is perhaps add a __all__ for this module? (in which case, you should perhaps have a NEWS entry).

@tungol tungol marked this pull request as draft December 15, 2024 03:44
@tungol tungol marked this pull request as ready for review December 15, 2024 03:52
@tungol
Copy link
Contributor Author

tungol commented Dec 15, 2024

I added __all__. All the other tkinter.* submodules have one, so that keeps this consistent.

…sGnh9.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants