mypy: Fix future syntax errors and other minor mistakes.

When we move to the Python 3 mypy syntax, we can't reference a class
before its definition.
This commit is contained in:
rht
2017-10-05 08:05:41 +02:00
committed by Tim Abbott
parent 0b6bcc9c33
commit 34bafa654c
4 changed files with 19 additions and 20 deletions

View File

@@ -20,7 +20,7 @@ class Graph(object):
self.nodes.add(child)
def copy(self):
# type: () -> Graph
# type: () -> 'Graph'
return Graph(self.edges())
def num_edges(self):
@@ -28,7 +28,7 @@ class Graph(object):
return len(self.edges())
def minus_edge(self, edge):
# type: (Edge) -> Graph
# type: (Edge) -> 'Graph'
edges = self.edges().copy()
edges.remove(edge)
return Graph(edges)