--- bipaddress.py 2015-01-20 20:00:36.325503808 +0100 +++ aipaddress.py 2015-01-20 19:59:57.025308929 +0100 @@ -176,7 +176,9 @@ it = iter(addresses) first = last = next(it) for ip in it: - if ip._ip != last._ip + 1: + if ip._ip == last._ip: + continue + elif ip._ip != last._ip + 1: yield first, last first = ip last = ip @@ -347,7 +349,7 @@ nets.append(ip) # sort and dedup - ips = sorted(set(ips)) + ips = sorted(ips) # find consecutive address ranges in the sorted sequence and summarize them if ips: