bpo-18802: ipaddress documentation changes by csabella · Pull Request #6083 · python/cpython (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"starts with a zero field" is wrong. 128.0.0.0 is* accepted as the netmask for a /1 network, 127.255.255.255 is* accepted as the hostmask for a /1 network, neither starts with a zero field.
How about: "interpreted as a net mask if it is a valid net mask, or interpreted as a host mask otherwise."?
(* Or they were when I originally wrote the patch, I haven't looked to see if the code has changed since).