From 333d415b6c4c3beb1ad8d35f5bd17f9747fe7145 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Thu, 15 Jun 2023 01:03:36 +0200 Subject: [PATCH] Add a few types to make mypy happier --- birdvisu/maps_new/__init__.py | 2 +- birdvisu/maps_new/providers.py | 2 +- birdvisu/ospfsock.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/birdvisu/maps_new/__init__.py b/birdvisu/maps_new/__init__.py index 602b4be..3b82517 100644 --- a/birdvisu/maps_new/__init__.py +++ b/birdvisu/maps_new/__init__.py @@ -144,7 +144,7 @@ class AnnotatedTopology: # TODO: maybe class to handle sets of annotators? def annotate_topology(topology, annotators: Sequence[Callable[[AnnotatedTopology], AnnotatedTopology]], - initial_annotation: AnnotatedTopology = None, + initial_annotation: AnnotatedTopology | None = None, ) -> AnnotatedTopology: """Runs all the annotators and assigns all the tags. diff --git a/birdvisu/maps_new/providers.py b/birdvisu/maps_new/providers.py index 7bda803..41e3e32 100644 --- a/birdvisu/maps_new/providers.py +++ b/birdvisu/maps_new/providers.py @@ -16,7 +16,7 @@ class OspfDataTopologyProvider(TopologyProvider): # feel trustworthy (I don't really understand them, but I think they # depend on designated routers and interface numbers, changes of which # 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: # TODO: Should we support global visualisation configuration? for directive, details in parsed: diff --git a/birdvisu/ospfsock.py b/birdvisu/ospfsock.py index cd8be45..b034d06 100644 --- a/birdvisu/ospfsock.py +++ b/birdvisu/ospfsock.py @@ -46,7 +46,7 @@ class BirdSocketConnection: self.socket.send(binreq) 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 # 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