diff --git a/ipranges.py b/ipranges.py index bcbef0a3b1c7172d393f0c57cd98567f8ec8b13d..065f9669e39ec379ea3c68e0142e6ac10b37f5bb 100644 --- a/ipranges.py +++ b/ipranges.py @@ -26,7 +26,9 @@ class Range(object): return self.high() - self.low() + 1 def __eq__(self, other): - return (self.low() == other.low() and self.high() == other.high()) + 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)