-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipaddress ver. 1.0.14 IPv4Network off by 1 #74592
Comments
for x in ipaddress.IPv4Network(u"192.168.0.0/23").hosts():
print x contains 192.168.1.0 but does not contain 192.168.1.255 ipaddress version 1.0.14 |
tested with 1.0.18 with same results. |
See the doc: https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Network.hosts. For hosts() method, network address and broadcast address are excluded from the result. So it's right IPv4Address('192.168.0.0') and IPv4Address('192.168.1.255') are not included. |
i thought it was inconsistent that |
"192.168.0.0" is the network address of "192.168.0.0/23" while "192.168.1.0" not. :-) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: