[issue20860] ipaddress network subnets() method should return object with __getitem__

STINNER Victor report at bugs.python.org
Thu Mar 6 23:33:01 CET 2014


STINNER Victor added the comment:

"It would be very useful to be able to not only iterate through subnets, but also index a subnet."

For your information, the IPy module supports that:

>>> tuple(IPy.IP('192.168.1.128/31'))
(IP('192.168.1.128'), IP('192.168.1.129'))
>>> IPy.IP('2000::/3')[2**120]
IP('2100::')

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20860>
_______________________________________


More information about the Python-bugs-list mailing list