Message271972
Between Python 3.4 (3.4.5 I've tested with) and Python 3.5 (3.5.2), the behavior of ipaddress's subnet() method changed.
This code:
$ cat iat.py
import ipaddress
p = ipaddress.IPv4Network("172.0.0.4/30")
subnets = p.subnets(new_prefix=31)
n = next(subnets)
print(list(n.hosts()))
has two different outcomes on 3.4 vs. 3.5:
$ python3.4 iat.py
[IPv4Address('172.0.0.4'), IPv4Address('172.0.0.5')]
$ python3.5 iat.py
[]
AIUI, the 3.4 behavior is the correct one (or the docs need to be fixed). |
|
Date |
User |
Action |
Args |
2016-08-04 13:07:37 | tklausmann | set | recipients:
+ tklausmann |
2016-08-04 13:07:37 | tklausmann | set | messageid: <1470316057.21.0.151567664395.issue27683@psf.upfronthosting.co.za> |
2016-08-04 13:07:37 | tklausmann | link | issue27683 messages |
2016-08-04 13:07:37 | tklausmann | create | |
|