summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/__init__.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-04-04 12:45:02 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-04-04 12:45:02 (GMT)
commitbcc174615ca2bd5fe60442407ca1411759d823cf (patch)
tree5d4b3ea30ef71af773e2576bfc7584ff25d230ff /Lib/tkinter/__init__.py
parent578c9211d6b57bbb3cc00ba6dd55893814168695 (diff)
downloadcpython-bcc174615ca2bd5fe60442407ca1411759d823cf.zip
cpython-bcc174615ca2bd5fe60442407ca1411759d823cf.tar.gz
cpython-bcc174615ca2bd5fe60442407ca1411759d823cf.tar.bz2
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 4ac4e57a..f60923a 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_):