[issue38655] ipaddress.ip_network('0.0.0.0/0').is_private == True

Ammar Askar report at bugs.python.org
Tue Nov 5 00:06:19 EST 2019


Ammar Askar <ammar at ammaraskar.com> added the comment:

The documentation for is_private notes:

  Returns:
  A boolean, True if the address is reserved per RFC 4193.
  iana-ipv4-special-registry or iana-ipv6-special-registry.

If we take a look at the iana-ipv4-special-registry then 0.0.0.0/8 does show up there: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml

While the name might be a misnomer, is_reserved instead of is_private might have been better, it does seem to conform to what the documentation says it will do.

----------
nosy: +ammar2

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


More information about the Python-bugs-list mailing list