From c7600b4c7e558d3c05485f76cfcdd3e807c6b13e Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Sun, 8 Jan 2023 10:42:19 +0200 Subject: add type checking for graph __eq__ (#2531) --- redis/commands/graph/node.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'redis/commands/graph/node.py') diff --git a/redis/commands/graph/node.py b/redis/commands/graph/node.py index 0ebe510..4546a39 100644 --- a/redis/commands/graph/node.py +++ b/redis/commands/graph/node.py @@ -65,6 +65,10 @@ class Node: return res def __eq__(self, rhs): + # Type checking + if not isinstance(rhs, Node): + return False + # Quick positive check, if both IDs are set. if self.id is not None and rhs.id is not None and self.id != rhs.id: return False -- cgit v1.2.1