Source

python-hs-benchmark / redispy.py

import redis

class Client(object):
    def __init__(self, dummyparam):
        self.client = redis.Redis(host='localhost', port=6379, db=1)

    def __getattr__(self, attr):
        if attr in self.__dict__:
            return self.__dict__[attr]
        else:
            return getattr(self.client, attr)

    def __iter__(self):
        return iter(self.client)