diff options
-rw-r--r-- | Lib/lib-tk/Canvas.py | 2 | ||||
-rw-r--r-- | Lib/plat-riscos/riscosenviron.py | 2 | ||||
-rw-r--r-- | Lib/xml/sax/xmlreader.py | 3 |
3 files changed, 7 insertions, 0 deletions
diff --git a/Lib/lib-tk/Canvas.py b/Lib/lib-tk/Canvas.py index ed4ba34..ae2ced1 100644 --- a/Lib/lib-tk/Canvas.py +++ b/Lib/lib-tk/Canvas.py @@ -39,6 +39,8 @@ class CanvasItem: return self._keys def has_key(self, key): return key in self.keys() + def __contains__(self, key): + return key in self.keys() def addtag(self, tag, option='withtag'): self.canvas.addtag(tag, option, self.id) def bbox(self): diff --git a/Lib/plat-riscos/riscosenviron.py b/Lib/plat-riscos/riscosenviron.py index d92aa31..95a2ce5 100644 --- a/Lib/plat-riscos/riscosenviron.py +++ b/Lib/plat-riscos/riscosenviron.py @@ -32,6 +32,8 @@ class _Environ: def has_key(self, key): value = riscos.getenv(key) return value<>None + def __contains__(self, key): + return riscos.getenv(key) is not None def update(self, dict): for k, v in dict.items(): riscos.putenv(k, v) diff --git a/Lib/xml/sax/xmlreader.py b/Lib/xml/sax/xmlreader.py index f1c9d9d..9a2361e 100644 --- a/Lib/xml/sax/xmlreader.py +++ b/Lib/xml/sax/xmlreader.py @@ -321,6 +321,9 @@ class AttributesImpl: def has_key(self, name): return self._attrs.has_key(name) + def __contains__(self, name): + return self._attrs.has_key(name) + def get(self, name, alternative=None): return self._attrs.get(name, alternative) |