def __init__(self, servers, debug=0, pickleProtocol=0,
                 pickler=pickle.Pickler, unpickler=pickle.Unpickler,
                 pload=None, pid=None,
                 server_max_key_length=SERVER_MAX_KEY_LENGTH,
                 server_max_value_length=SERVER_MAX_VALUE_LENGTH,
                 dead_retry=_DEAD_RETRY, socket_timeout=_SOCKET_TIMEOUT,
                 cache_cas = False, flush_on_reconnect=0, check_keys=True):
        """
        Create a new Client object with the given list of servers.

        @param servers: C{servers} is passed to L{set_servers}.
        @param debug: whether to display error messages when a server can't be
        contacted.
        @param pickleProtocol: number to mandate protocol used by (c)Pickle.
        @param pickler: optional override of default Pickler to allow subclassing.
        @param unpickler: optional override of default Unpickler to allow subclassing.
        @param pload: optional persistent_load function to call on pickle loading.
        Useful for cPickle since subclassing isn't allowed.
        @param pid: optional persistent_id function to call on pickle storing.
        Useful for cPickle since subclassing isn't allowed.
        @param dead_retry: number of seconds before retrying a blacklisted
        server. Default to 30 s.
        @param socket_timeout: timeout in seconds for all calls to a server. Defaults
        to 3 seconds.
        @param cache_cas: (default False) If true, cas operations will be
        cached.  WARNING: This cache is not expired internally, if you have
        a long-running process you will need to expire it manually via
        client.reset_cas(), or the cache can grow unlimited.
        @param server_max_key_length: (default SERVER_MAX_KEY_LENGTH)
        Data that is larger than this will not be sent to the server.
        @param server_max_value_length: (default SERVER_MAX_VALUE_LENGTH)
        Data that is larger than this will not be sent to the server.
        @param flush_on_reconnect: optional flag which prevents a scenario that
        can cause stale data to be read: If there's more than one memcached
        server and the connection to one is interrupted, keys that mapped to
        that server will get reassigned to another. If the first server comes
        back, those keys will map to it again. If it still has its data, get()s
        can read stale data that was overwritten on another server. This flag
        is off by default for backwards compatibility.
        @param check_keys: (default True) If True, the key is checked to
        ensure it is the correct length and composed of the right characters.
        """
        local.__init__(self)
        self.debug = debug
        self.dead_retry = dead_retry
        self.socket_timeout = socket_timeout
        self.flush_on_reconnect = flush_on_reconnect
        self.set_servers(servers)
        self.stats = {}
        self.cache_cas = cache_cas
        self.reset_cas()
        self.do_check_key = check_keys

        # Allow users to modify pickling/unpickling behavior
        self.pickleProtocol = pickleProtocol
        self.pickler = pickler
        self.unpickler = unpickler
        self.persistent_load = pload
        self.persistent_id = pid
        self.server_max_key_length = server_max_key_length
        self.server_max_value_length = server_max_value_length

        #  figure out the pickler style
        file = StringIO()
        try:
            pickler = self.pickler(file, protocol = self.pickleProtocol)
            self.picklerIsKeyword = True
        except TypeError:
            self.picklerIsKeyword = False
def __init__ ( self , servers , debug = 0 , pickleProtocol = 0 , pickler = pickle . Pickler , unpickler = pickle . Unpickler , pload = None , pid = None , server_max_key_length = SERVER_MAX_KEY_LENGTH , server_max_value_length = SERVER_MAX_VALUE_LENGTH , dead_retry = _DEAD_RETRY , socket_timeout = _SOCKET_TIMEOUT , cache_cas = False , flush_on_reconnect = 0 , check_keys = True ) : local . __init__ ( self ) self . debug = debug self . dead_retry = dead_retry self . socket_timeout = socket_timeout self . flush_on_reconnect = flush_on_reconnect self . set_servers ( servers ) self . stats = { } self . cache_cas = cache_cas self . reset_cas ( ) self . do_check_key = check_keys self . pickleProtocol = pickleProtocol self . pickler = pickler self . unpickler = unpickler self . persistent_load = pload self . persistent_id = pid self . server_max_key_length = server_max_key_length self . server_max_value_length = server_max_value_length file = StringIO ( ) try : pickler = self . pickler ( file , protocol = self . pickleProtocol ) self . picklerIsKeyword = True except TypeError : self . picklerIsKeyword = False
Create a new Client object with the given list of servers.

        @param servers: C{servers} is passed to L{set_servers}.
        @param debug: whether to display error messages when a server can't be
        contacted.
        @param pickleProtocol: number to mandate protocol used by (c)Pickle.
        @param pickler: optional override of default Pickler to allow subclassing.
        @param unpickler: optional override of default Unpickler to allow subclassing.
        @param pload: optional persistent_load function to call on pickle loading.
        Useful for cPickle since subclassing isn't allowed.
        @param pid: optional persistent_id function to call on pickle storing.
        Useful for cPickle since subclassing isn't allowed.
        @param dead_retry: number of seconds before retrying a blacklisted
        server. Default to 30 s.
        @param socket_timeout: timeout in seconds for all calls to a server. Defaults
        to 3 seconds.
        @param cache_cas: (default False) If true, cas operations will be
        cached.  WARNING: This cache is not expired internally, if you have
        a long-running process you will need to expire it manually via
        client.reset_cas(), or the cache can grow unlimited.
        @param server_max_key_length: (default SERVER_MAX_KEY_LENGTH)
        Data that is larger than this will not be sent to the server.
        @param server_max_value_length: (default SERVER_MAX_VALUE_LENGTH)
        Data that is larger than this will not be sent to the server.
        @param flush_on_reconnect: optional flag which prevents a scenario that
        can cause stale data to be read: If there's more than one memcached
        server and the connection to one is interrupted, keys that mapped to
        that server will get reassigned to another. If the first server comes
        back, those keys will map to it again. If it still has its data, get()s
        can read stale data that was overwritten on another server. This flag
        is off by default for backwards compatibility.
        @param check_keys: (default True) If True, the key is checked to
        ensure it is the correct length and composed of the right characters.