From ae019e14bd808c80f010d800ce09630698b60961 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 20 May 2008 08:48:34 +0000 Subject: [PATCH] #615772: raise a more explicit error from Tkinter.Misc.__contains__. --- Lib/lib-tk/Tkinter.py | 2 ++ 1 file changed, 2 insertions(+) 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:], -- 2.50.1