[issue38784] ip_network does not clear/update the broadcast_address cache when network_address is changed.

Inada Naoki report at bugs.python.org
Wed Nov 13 09:16:39 EST 2019


Inada Naoki <songofacandy at gmail.com> added the comment:

It is documented, if you read it carefully.

"Network objects are hashable, so they can be used as keys in dictionaries."

https://docs.python.org/3/library/ipaddress.html#network-objects

"""
An object is hashable if it has a hash value which never changes during its lifetime (it needs a __hash__() method), and can be compared to other objects (it needs an __eq__() method). Hashable objects which compare equal must have the same hash value.
"""

https://docs.python.org/3/glossary.html#term-hashable

Make it mutable is not an option.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38784>
_______________________________________


More information about the Python-bugs-list mailing list