Skip to content
Snippets Groups Projects
Commit 8c94524b authored by Rajmund Hruška's avatar Rajmund Hruška
Browse files

Add equality with arbitrary objects

parent 55f86ecb
No related branches found
No related tags found
1 merge request!9Add equality with arbitrary objects
Pipeline #12420 failed
......@@ -26,7 +26,9 @@ class Range(object):
return self.high() - self.low() + 1
def __eq__(self, other):
if isinstance(other, (IPRangeBase, IPNetBase, IPAddrBase)):
return (self.low() == other.low() and self.high() == other.high())
return False
def __ne__(self, other):
return not self.__eq__(other)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment