def get_instance ( key , expire = None ) : global _instances try : instance = _instances [ key ] except KeyError : instance = RedisSet ( key , _redis , expire = expire ) _instances [ key ] = instance return instance
python redis set return value
Return an instance of RedisSet .
def get_instance(key, expire=None):
    """Return an instance of RedisSet."""
    global _instances
    try:
        instance = _instances[key]
    except KeyError:
        instance = RedisSet(
            key,
            _redis,
            expire=expire
        )
        _instances[key] = instance

    return instance