Skip to content

Commit a65789b

Browse files
pythongh-118760: Restore the default value of tkiter.wantobjects to 1
It was set to 2 in 65f5e58 (pythonGH-98592).
1 parent 7b0c247 commit a65789b

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

Doc/whatsnew/3.13.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,16 +2169,6 @@ Changes in the Python API
21692169
returned by :meth:`zipfile.ZipFile.open` was changed from ``'r'`` to ``'rb'``.
21702170
(Contributed by Serhiy Storchaka in :gh:`115961`.)
21712171

2172-
* Callbacks registered in the :mod:`tkinter` module now take arguments as
2173-
various Python objects (``int``, ``float``, ``bytes``, ``tuple``),
2174-
not just ``str``.
2175-
To restore the previous behavior set :mod:`!tkinter` module global
2176-
:data:`!wantobject` to ``1`` before creating the
2177-
:class:`!Tk` object or call the :meth:`!wantobject`
2178-
method of the :class:`!Tk` object with argument ``1``.
2179-
Calling it with argument ``2`` restores the current default behavior.
2180-
(Contributed by Serhiy Storchaka in :gh:`66410`.)
2181-
21822172

21832173
Changes in the C API
21842174
--------------------

Lib/tkinter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from tkinter.constants import *
4141
import re
4242

43-
wantobjects = 2
43+
wantobjects = 1
4444
_debug = False # set to True to print executed Tcl/Tk commands
4545

4646
TkVersion = float(_tkinter.TK_VERSION)

Misc/NEWS.d/3.13.0b1.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,9 +1346,10 @@ urllib.
13461346
.. nonce: du4UKW
13471347
.. section: Library
13481348
1349-
Callbacks registered in the :mod:`tkinter` module now take arguments as
1350-
various Python objects (``int``, ``float``, ``bytes``, ``tuple``), not just
1351-
``str``. To restore the previous behavior set :mod:`!tkinter` module global
1349+
Add support for passing arguments to callbacks registered in the :mod:`tkinter`
1350+
module as various Python objects (``int``, ``float``, ``bytes``, ``tuple``),
1351+
corresponding to the original Tcl value, not just ``str``, and enable this by default.
1352+
To restore the previous behavior set :mod:`!tkinter` module global
13521353
:data:`~tkinter.wantobject` to ``1`` before creating the
13531354
:class:`~tkinter.Tk` object or call the :meth:`~tkinter.Tk.wantobject`
13541355
method of the :class:`!Tk` object with argument ``1``. Calling it with
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Restore the default value of ``tkiter.wantobjects`` to ``1``.

0 commit comments

Comments
 (0)