def __contains__(self, key): with _lock: self.__check_closed() key = _checkstr(key) return lib.pygdbm_exists(self.__ll_dbm, key, len(key))