From: Georg Brandl Date: Tue, 20 May 2008 08:48:34 +0000 (+0000) Subject: #615772: raise a more explicit error from Tkinter.Misc.__contains__. X-Git-Tag: v2.6b1~307 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae019e14bd808c80f010d800ce09630698b60961;p=python #615772: raise a more explicit error from Tkinter.Misc.__contains__. --- diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index eb8fd441be..5e3938d4c1 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -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:],