def __init__(self, host, port, backup_nodes, logger):
    'Creates a new deque with the primary host first, followed by any backup hosts'
    self._logger = logger
    self.address_deque = deque()
    self._append(host, port)
    if (not isinstance(backup_nodes, list)):
        err_msg = 'Connection option "backup_server_node" must be a list'
        self._logger.error(err_msg)
        raise TypeError(err_msg)
    for node in backup_nodes:
        if isinstance(node, string_types):
            self._append(node, DEFAULT_PORT)
        elif (isinstance(node, tuple) and (len(node) == 2)):
            self._append(node[0], node[1])
        else:
            err_msg = 'Each item of connection option "backup_server_node" must be a host string or a (host, port) tuple'
            self._logger.error(err_msg)
            raise TypeError(err_msg)
    self._logger.debug('Address list: {0}'.format(list(self.address_deque)))
Creates a new deque with the primary host first, followed by any backup hosts
def __init__(self, host, port, backup_nodes, logger):
    
    self._logger = logger
    self.address_deque = deque()
    self._append(host, port)
    if (not isinstance(backup_nodes, list)):
        err_msg = 'Connection option "backup_server_node" must be a list'
        self._logger.error(err_msg)
        raise TypeError(err_msg)
    for node in backup_nodes:
        if isinstance(node, string_types):
            self._append(node, DEFAULT_PORT)
        elif (isinstance(node, tuple) and (len(node) == 2)):
            self._append(node[0], node[1])
        else:
            err_msg = 'Each item of connection option "backup_server_node" must be a host string or a (host, port) tuple'
            self._logger.error(err_msg)
            raise TypeError(err_msg)
    self._logger.debug('Address list: {0}'.format(list(self.address_deque)))