def test_values(self): self.store['max'] = 3 self.store['min'] = 6 self.store['pow'] = 7 self.store.sync() slist = list(values(self.store)) self.assertEqual(6 in slist, True)
def values(self): loads = self.loads try: self._store.execute("SELECT svalues(data) as v FROM shove") for v in values(self._store.fetchall()["v"]): yield loads(v) except psycopg2.ProgrammingError: self._conn.rollback()
def __getattr__(self, key, _getter=object.__getattribute__): try: return self[key] except KeyError: if key == 'iteritems': return items(self) elif key == 'iterkeys': return keys(self) elif key == 'itervalues': return values(self) return _getter(self, key)
def __getattr__(self, key, _getter=object.__getattribute__): try: if key == 'iteritems': return items(self) elif key == 'iterkeys': return keys(self) elif key == 'itervalues': return values(self) return _getter(self, key) except AttributeError: return self[key]