mirror of
https://github.com/python/cpython
synced 2026-09-29 11:10:30 +03:00
Added a __contains__ method.
This commit is contained in:
parent
b417936d40
commit
c7554e28ee
1 changed files with 3 additions and 0 deletions
|
|
@ -176,6 +176,9 @@ class IC:
|
|||
return rv
|
||||
|
||||
def has_key(self, key):
|
||||
return self.__contains__(key)
|
||||
|
||||
def __contains__(self, key):
|
||||
try:
|
||||
dummy = self.ic.ICFindPrefHandle(key, self.h)
|
||||
except icglue.error:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue