Add a few types to make mypy happier

master
LEdoian 1 year ago
parent 4b9276621d
commit 333d415b6c

@ -144,7 +144,7 @@ class AnnotatedTopology:
# TODO: maybe class to handle sets of annotators? # TODO: maybe class to handle sets of annotators?
def annotate_topology(topology, def annotate_topology(topology,
annotators: Sequence[Callable[[AnnotatedTopology], AnnotatedTopology]], annotators: Sequence[Callable[[AnnotatedTopology], AnnotatedTopology]],
initial_annotation: AnnotatedTopology = None, initial_annotation: AnnotatedTopology | None = None,
) -> AnnotatedTopology: ) -> AnnotatedTopology:
"""Runs all the annotators and assigns all the tags. """Runs all the annotators and assigns all the tags.

@ -16,7 +16,7 @@ class OspfDataTopologyProvider(TopologyProvider):
# feel trustworthy (I don't really understand them, but I think they # feel trustworthy (I don't really understand them, but I think they
# depend on designated routers and interface numbers, changes of which # depend on designated routers and interface numbers, changes of which
# should not cause us to think that is a different network) # should not cause us to think that is a different network)
self.network_renames = {} self.network_renames : dict[str,str] = {}
# We only care for areas: # We only care for areas:
# TODO: Should we support global visualisation configuration? # TODO: Should we support global visualisation configuration?
for directive, details in parsed: for directive, details in parsed:

@ -46,7 +46,7 @@ class BirdSocketConnection:
self.socket.send(binreq) self.socket.send(binreq)
return self._parse_response() return self._parse_response()
def _parse_response(self): def _parse_response(self) -> BirdResponse:
# We even read from the socket here in order to have the whole protocol # We even read from the socket here in order to have the whole protocol
# described at one place. Therefore other parts of the code do not need # described at one place. Therefore other parts of the code do not need
# to know anything about the protocol (maybe apart from the meaning of # to know anything about the protocol (maybe apart from the meaning of

Loading…
Cancel
Save