From f7d881602869efebab2346fc8c0baaf537ad09be Mon Sep 17 00:00:00 2001 From: Stephen Morton Date: Fri, 13 Dec 2024 13:20:50 -0800 Subject: [PATCH 1/3] use explicit imports in tkinter.simpledialog --- Lib/tkinter/simpledialog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/tkinter/simpledialog.py b/Lib/tkinter/simpledialog.py index 6e5b025a9f9d7d..0cd827049994cf 100644 --- a/Lib/tkinter/simpledialog.py +++ b/Lib/tkinter/simpledialog.py @@ -23,9 +23,10 @@ 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 class SimpleDialog: From 23f0115be6138e5c56d4ba8a52e1d7d82863fd84 Mon Sep 17 00:00:00 2001 From: Stephen Morton Date: Sat, 14 Dec 2024 19:51:52 -0800 Subject: [PATCH 2/3] add __all__ and a NEWS entry --- Lib/tkinter/simpledialog.py | 2 ++ .../next/Library/2024-12-14-19-51-39.gh-issue-127930.WsGnh9.rst | 1 + 2 files changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2024-12-14-19-51-39.gh-issue-127930.WsGnh9.rst diff --git a/Lib/tkinter/simpledialog.py b/Lib/tkinter/simpledialog.py index 0cd827049994cf..4f9eb44f034677 100644 --- a/Lib/tkinter/simpledialog.py +++ b/Lib/tkinter/simpledialog.py @@ -28,6 +28,8 @@ 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 00000000000000..8b114231ee22b7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-12-14-19-51-39.gh-issue-127930.WsGnh9.rst @@ -0,0 +1 @@ +Add :attr:`__all__` to :mod:`tkinter.simpledialog`. From 54d2b5e92d70c3ab10a8d19784a4173fc3e08d28 Mon Sep 17 00:00:00 2001 From: Stephen Morton Date: Sun, 15 Dec 2024 03:06:35 -0800 Subject: [PATCH 3/3] Update Misc/NEWS.d/next/Library/2024-12-14-19-51-39.gh-issue-127930.WsGnh9.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- .../next/Library/2024-12-14-19-51-39.gh-issue-127930.WsGnh9.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 8b114231ee22b7..0e1e8a9d6eb10a 100644 --- 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 @@ -1 +1 @@ -Add :attr:`__all__` to :mod:`tkinter.simpledialog`. +Add ``__all__`` to :mod:`tkinter.simpledialog`.