(self,
                 topology_type,
                 server_descriptions,
                 replica_set_name,
                 max_set_version,
                 max_election_id,
                 topology_settings)
Representation of a deployment of MongoDB servers.

        :Parameters:
          - `topology_type`: initial type
          - `server_descriptions`: dict of (address, ServerDescription) for
            all seeds
          - `replica_set_name`: replica set name or None
          - `max_set_version`: greatest setVersion seen from a primary, or None
          - `max_election_id`: greatest electionId seen from a primary, or None
          - `topology_settings`: a TopologySettings
Representation of a deployment of MongoDB servers.
Representation of a deployment of MongoDB servers .
def __init__(self,
                 topology_type,
                 server_descriptions,
                 replica_set_name,
                 max_set_version,
                 max_election_id,
                 topology_settings):
        """Representation of a deployment of MongoDB servers.

        :Parameters:
          - `topology_type`: initial type
          - `server_descriptions`: dict of (address, ServerDescription) for
            all seeds
          - `replica_set_name`: replica set name or None
          - `max_set_version`: greatest setVersion seen from a primary, or None
          - `max_election_id`: greatest electionId seen from a primary, or None
          - `topology_settings`: a TopologySettings
        """
        self._topology_type = topology_type
        self._replica_set_name = replica_set_name
        self._server_descriptions = server_descriptions
        self._max_set_version = max_set_version
        self._max_election_id = max_election_id

        # The heartbeat_frequency is used in staleness estimates.
        self._topology_settings = topology_settings

        # Is PyMongo compatible with all servers' wire protocols?
        self._incompatible_err = None

        for s in self._server_descriptions.values():
            # s.min/max_wire_version is the server's wire protocol.
            # MIN/MAX_SUPPORTED_WIRE_VERSION is what PyMongo supports.
            server_too_new = (
                # Server too new.
                s.min_wire_version is not None
                and s.min_wire_version > common.MAX_SUPPORTED_WIRE_VERSION)

            server_too_old = (
                # Server too old.
                s.max_wire_version is not None
                and s.max_wire_version < common.MIN_SUPPORTED_WIRE_VERSION)

            if server_too_new or server_too_old:
                self._incompatible_err = (
                    "Server at %s:%d "
                    "uses wire protocol versions %d through %d, "
                    "but PyMongo only supports %d through %d"
                    % (s.address[0], s.address[1],
                       s.min_wire_version, s.max_wire_version,
                       common.MIN_SUPPORTED_WIRE_VERSION,
                       common.MAX_SUPPORTED_WIRE_VERSION))

                break
def __init__ ( self , topology_type , server_descriptions , replica_set_name , max_set_version , max_election_id , topology_settings ) : self . _topology_type = topology_type self . _replica_set_name = replica_set_name self . _server_descriptions = server_descriptions self . _max_set_version = max_set_version self . _max_election_id = max_election_id # The heartbeat_frequency is used in staleness estimates. self . _topology_settings = topology_settings # Is PyMongo compatible with all servers' wire protocols? self . _incompatible_err = None for s in self . _server_descriptions . values ( ) : # s.min/max_wire_version is the server's wire protocol. # MIN/MAX_SUPPORTED_WIRE_VERSION is what PyMongo supports. server_too_new = ( # Server too new. s . min_wire_version is not None and s . min_wire_version > common . MAX_SUPPORTED_WIRE_VERSION ) server_too_old = ( # Server too old. s . max_wire_version is not None and s . max_wire_version < common . MIN_SUPPORTED_WIRE_VERSION ) if server_too_new or server_too_old : self . _incompatible_err = ( "Server at %s:%d " "uses wire protocol versions %d through %d, " "but PyMongo only supports %d through %d" % ( s . address [ 0 ] , s . address [ 1 ] , s . min_wire_version , s . max_wire_version , common . MIN_SUPPORTED_WIRE_VERSION , common . MAX_SUPPORTED_WIRE_VERSION ) ) break