mirror of https://github.com/python/cpython.git
Added a __contains__ method.
This commit is contained in:
parent
b417936d40
commit
c7554e28ee
|
@ -176,6 +176,9 @@ def keys(self):
|
||||||
return rv
|
return rv
|
||||||
|
|
||||||
def has_key(self, key):
|
def has_key(self, key):
|
||||||
|
return self.__contains__(key)
|
||||||
|
|
||||||
|
def __contains__(self, key):
|
||||||
try:
|
try:
|
||||||
dummy = self.ic.ICFindPrefHandle(key, self.h)
|
dummy = self.ic.ICFindPrefHandle(key, self.h)
|
||||||
except icglue.error:
|
except icglue.error:
|
||||||
|
|
Loading…
Reference in New Issue