]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118760: Restore the default value of tkinter.wantobjects to 1 (GH-118784)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 20 May 2024 19:21:04 +0000 (22:21 +0300)
committerGitHub <noreply@github.com>
Mon, 20 May 2024 19:21:04 +0000 (22:21 +0300)
It was set to 2 in 65f5e586a1239ed1a66d8284773d7b02ce40e480 (GH-98592).

Doc/whatsnew/3.13.rst
Lib/tkinter/__init__.py
Misc/NEWS.d/3.13.0b1.rst
Misc/NEWS.d/next/Library/2024-05-08-21-30-33.gh-issue-118760.XvyMHn.rst [new file with mode: 0644]

index effa554bfe8469ef9001b6b96784a4998c428ed7..dd5190d63ec579442b860157a06aefbfd0b906d5 100644 (file)
@@ -2177,16 +2177,6 @@ Changes in the Python API
   returned by :meth:`zipfile.ZipFile.open` was changed from ``'r'`` to ``'rb'``.
   (Contributed by Serhiy Storchaka in :gh:`115961`.)
 
-* Callbacks registered in the :mod:`tkinter` module now take arguments as
-  various Python objects (``int``, ``float``, ``bytes``, ``tuple``),
-  not just ``str``.
-  To restore the previous behavior set :mod:`!tkinter` module global
-  :data:`!wantobject` to ``1`` before creating the
-  :class:`!Tk` object or call the :meth:`!wantobject`
-  method of the :class:`!Tk` object with argument ``1``.
-  Calling it with argument ``2`` restores the current default behavior.
-  (Contributed by Serhiy Storchaka in :gh:`66410`.)
-
 
 Changes in the C API
 --------------------
index f03da0ff5f98ec291b20cdc67088687a4b5f1855..5352276e874bf524a17feef056a1e1c9a18dbc57 100644 (file)
@@ -40,7 +40,7 @@ TclError = _tkinter.TclError
 from tkinter.constants import *
 import re
 
-wantobjects = 2
+wantobjects = 1
 _debug = False  # set to True to print executed Tcl/Tk commands
 
 TkVersion = float(_tkinter.TK_VERSION)
index 8d49ff06efd07b8702ac5b612bc5ba2cdafbc296..c3bfcc83f2ae7c90fe7488ca67f37015c644254c 100644 (file)
@@ -1346,13 +1346,13 @@ urllib.
 .. nonce: du4UKW
 .. section: Library
 
-Callbacks registered in the :mod:`tkinter` module now take arguments as
-various Python objects (``int``, ``float``, ``bytes``, ``tuple``), not just
-``str``. To restore the previous behavior set :mod:`!tkinter` module global
-:data:`~tkinter.wantobject` to ``1`` before creating the
-:class:`~tkinter.Tk` object or call the :meth:`~tkinter.Tk.wantobject`
-method of the :class:`!Tk` object with argument ``1``. Calling it with
-argument ``2`` restores the current default behavior.
+Setting the :mod:`!tkinter` module global :data:`~tkinter.wantobject` to ``2``
+before creating the :class:`~tkinter.Tk` object or call the
+:meth:`~tkinter.Tk.wantobject` method of the :class:`!Tk` object with argument
+``2`` makes now arguments to callbacks registered in the :mod:`tkinter` module
+to be passed as various Python objects (``int``, ``float``, ``bytes``, ``tuple``),
+depending on their internal represenation in Tcl, instead of always ``str``.
+:data:`!tkinter.wantobject` is now set to ``2`` by default.
 
 ..
 
diff --git a/Misc/NEWS.d/next/Library/2024-05-08-21-30-33.gh-issue-118760.XvyMHn.rst b/Misc/NEWS.d/next/Library/2024-05-08-21-30-33.gh-issue-118760.XvyMHn.rst
new file mode 100644 (file)
index 0000000..0e2712c
--- /dev/null
@@ -0,0 +1 @@
+Restore the default value of ``tkiter.wantobjects`` to ``1``.