You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As best as I can figure from tracing the relevant __init__() methods, self._ip and int(self.network.network_address) will always be identical. If that is so, this function could be simplified and save a few CPU cycles:
The value of `self._ip` and `int(self.network.network_address)` will
always be the identical. Therefore, it's unnecessary to include
`int(self.network.network_address)` in the tuple used to compute the
hash.
The
__hash__()
methods of theIPv4Interface
andIPv6Interface
classes are implemented on themain
branch as follows:https://github.com/python/cpython/blob/0afbd4e42ac28240b484cabe1710fdb6c572fb1f/Lib/ipaddress.py#L1457C1-L1459
As best as I can figure from tracing the relevant
__init__()
methods,self._ip
andint(self.network.network_address)
will always be identical. If that is so, this function could be simplified and save a few CPU cycles:Linked PRs
The text was updated successfully, but these errors were encountered: