[New-bugs-announce] [issue18802] ipaddress documentation errors

Jon Foster report at bugs.python.org
Wed Aug 21 23:00:57 CEST 2013

New submission from Jon Foster:

I recently looked at using the ipaddress module in a project, and noticed some discrepencies between the code and the documentation, and some things that weren't documented.  A patch to fix these is attached.

* The IPv4Network.__init__ documentation wrongly claims that "/"
  would be interpreted as a host mask i.e. "/32".  It's actually
  interpreted as a net mask, i.e. "/0".

* The IPv[46]Network.netmask property is not documented

* The IPv[46]Network.hostmask property is wrongly called "host mask"
  (with a space!) in the docs

* The IPv[46]Network.hostmask property is wrongly documented as a
  string but it's actually an IPv[46]Address

* The IPv6Network.__init__ documentation wrongly claims that a netmask
  can be specified, but this is not supported by the code.  The code
  only supports prefix lengths.

* The documentation should explain how network objects are ordered,
  since it's not obvious.

* The documentation should explain how interface objects are compared,
  both with other interface objects and with address objects, as it's
  not obvious.

* It's probably a good idea to document that you can't always pass a
  IPv4Interface object to a function that expects a IPv4Address.

* It would be nice to mention that address, network and interface objects
  are all hashable.

Kind regards,


components: Library (Lib)
files: ipaddress_docs_v1.patch
keywords: patch
messages: 195822
nosy: jongfoster
priority: normal
severity: normal
status: open
title: ipaddress documentation errors
versions: Python 3.4
Added file: http://bugs.python.org/file31410/ipaddress_docs_v1.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list