phihag/ipaddress — pull request #6 by Nicals (2013-09-05 19:11:04+00:00)
Title: Correct ip_network iterator

The original iterator uses the range function. Iterating large lists
using range can lead to an overflow error.

>>> import ipaddress
>>> for i in ipaddress.ip_network(unicode('2a00:70a0::/32')):
... pass
...
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/ipaddress.py", line 655, in __iter__
for x in range(network, broadcast + 1):
OverflowError: range() result has too many items