Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ffad633

Browse files
committed
Patch #518625: Return objects in Tkinter.
1 parent 52ea7e9 commit ffad633

3 files changed

Lines changed: 335 additions & 6 deletions

File tree

Lib/lib-tk/Tkinter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
except ImportError:
4646
_MacOS = None
4747

48+
want_objects = 1
49+
4850
TkVersion = float(_tkinter.TK_VERSION)
4951
TclVersion = float(_tkinter.TCL_VERSION)
5052

@@ -1521,6 +1523,7 @@ def __init__(self, screenName=None, baseName=None, className='Tk'):
15211523
if ext not in ('.py', '.pyc', '.pyo'):
15221524
baseName = baseName + ext
15231525
self.tk = _tkinter.create(screenName, baseName, className)
1526+
self.tk.wantobjects(want_objects)
15241527
if _MacOS and hasattr(_MacOS, 'SchedParams'):
15251528
# Disable event scanning except for Command-Period
15261529
_MacOS.SchedParams(1, 0)

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ Core and builtins
312312
Extension modules
313313
-----------------
314314

315+
- _tkinter now returns Tcl objects, instead of strings. Objects which
316+
have Python equivalents are converted to Python objects, other objects
317+
are wrapped. This can be configured through the wantobjects method,
318+
or Tkinter.want_objects.
319+
315320
- The PyBSDDB wrapper around the Sleepycat Berkely DB library has been
316321
added as the package bsddb. The traditional bsddb module is still
317322
available in source code, but not built automatically anymore, and

0 commit comments

Comments
 (0)