File tree 3 files changed +12
-0
lines changed
3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ def __str__(self):
61
61
return res
62
62
63
63
def __eq__ (self , rhs ):
64
+ # Type checking
65
+ if not isinstance (rhs , Edge ):
66
+ return False
67
+
64
68
# Quick positive check, if both IDs are set.
65
69
if self .id is not None and rhs .id is not None and self .id == rhs .id :
66
70
return True
Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ def __str__(self):
65
65
return res
66
66
67
67
def __eq__ (self , rhs ):
68
+ # Type checking
69
+ if not isinstance (rhs , Node ):
70
+ return False
71
+
68
72
# Quick positive check, if both IDs are set.
69
73
if self .id is not None and rhs .id is not None and self .id != rhs .id :
70
74
return False
Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ def add_edge(self, edge):
54
54
return self
55
55
56
56
def __eq__ (self , other ):
57
+ # Type checking
58
+ if not isinstance (other , Path ):
59
+ return False
60
+
57
61
return self .nodes () == other .nodes () and self .edges () == other .edges ()
58
62
59
63
def __str__ (self ):
You can’t perform that action at this time.
0 commit comments