diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py index 6e5a754c2acf1e..75b4c352c1d257 100644 --- a/Lib/ipaddress.py +++ b/Lib/ipaddress.py @@ -1420,7 +1420,7 @@ def __lt__(self, other): return False def __hash__(self): - return self._ip ^ self._prefixlen ^ int(self.network.network_address) + return hash((self._ip, self._prefixlen, int(self.network.network_address))) __reduce__ = _IPAddressBase.__reduce__ @@ -2120,7 +2120,7 @@ def __lt__(self, other): return False def __hash__(self): - return self._ip ^ self._prefixlen ^ int(self.network.network_address) + return hash((self._ip, self._prefixlen, int(self.network.network_address))) __reduce__ = _IPAddressBase.__reduce__