summaryrefslogtreecommitdiff
path: root/Lib/tkinter/__init__.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-04-04 15:45:02 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2014-04-04 15:45:02 +0300
commit1b9f43b8fa502dc422c4f89d4591eba3114e2434 (patch)
tree4b32c4681d5d23a157311fd725fa350a9cf79f9d /Lib/tkinter/__init__.py
parent06b466b137bd4d186c26542976ffc90012c00824 (diff)
downloadcpython-1b9f43b8fa502dc422c4f89d4591eba3114e2434.tar.gz
Issue #20636: Improved the repr of Tkinter widgets.
Diffstat (limited to 'Lib/tkinter/__init__.py')
-rw-r--r--Lib/tkinter/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index 4ac4e57ad2..f60923ad27 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -1280,6 +1280,11 @@ class Misc:
def __str__(self):
"""Return the window path name of this widget."""
return self._w
+
+ def __repr__(self):
+ return '<%s.%s object %s>' % (
+ self.__class__.__module__, self.__class__.__qualname__, self._w)
+
# Pack methods that apply to the master
_noarg_ = ['_noarg_']
def pack_propagate(self, flag=_noarg_):