]> granicus.if.org Git - python/commitdiff
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
authorGeorg Brandl <georg@python.org>
Tue, 20 May 2008 08:48:34 +0000 (08:48 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 20 May 2008 08:48:34 +0000 (08:48 +0000)
Lib/lib-tk/Tkinter.py

index eb8fd441beacd561af1932a23173548c0b54b240..5e3938d4c1ea1f54b551c8759ecd9a324c4c94fe 100644 (file)
@@ -1200,6 +1200,8 @@ class Misc:
     __getitem__ = cget
     def __setitem__(self, key, value):
         self.configure({key: value})
+    def __contains__(self, key):
+        raise TypeError("Tkinter objects don't support 'in' tests.")
     def keys(self):
         """Return a list of all resource names of this widget."""
         return map(lambda x: x[0][1:],