This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tklausmann
Recipients tklausmann
Date 2016-08-04.13:07:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1470316057.21.0.151567664395.issue27683@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2016-08-04 13:07:37tklausmannsetrecipients: + tklausmann
2016-08-04 13:07:37tklausmannsetmessageid: <1470316057.21.0.151567664395.issue27683@psf.upfronthosting.co.za>
2016-08-04 13:07:37tklausmannlinkissue27683 messages
2016-08-04 13:07:37tklausmanncreate