From: Stephen Morton Date: Sun, 14 Dec 2025 10:38:42 +0000 (-0800) Subject: gh-127930: use explicit imports in tkinter.simpledialog (#127931) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81bfcf1aaef4f558f893eeff41a5175af4f154e1;p=thirdparty%2FPython%2Fcpython.git gh-127930: use explicit imports in tkinter.simpledialog (#127931) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- diff --git a/Lib/tkinter/simpledialog.py b/Lib/tkinter/simpledialog.py index 6e5b025a9f9d..4f9eb44f0346 100644 --- a/Lib/tkinter/simpledialog.py +++ b/Lib/tkinter/simpledialog.py @@ -23,9 +23,12 @@ askfloat -- get a float from the user askstring -- get a string from the user """ -from tkinter import * +from tkinter import Button, Entry, Frame, Label, Message, Tk, Toplevel from tkinter import _get_temp_root, _destroy_temp_root from tkinter import messagebox +from tkinter.constants import ACTIVE, BOTH, END, LEFT, RIDGE, W, E + +__all__ = ["SimpleDialog", "Dialog", "askinteger", "askfloat", "askstring"] class SimpleDialog: diff --git a/Misc/NEWS.d/next/Library/2024-12-14-19-51-39.gh-issue-127930.WsGnh9.rst b/Misc/NEWS.d/next/Library/2024-12-14-19-51-39.gh-issue-127930.WsGnh9.rst new file mode 100644 index 000000000000..0e1e8a9d6eb1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-12-14-19-51-39.gh-issue-127930.WsGnh9.rst @@ -0,0 +1 @@ +Add ``__all__`` to :mod:`tkinter.simpledialog`.