ipaddress.collapse_addresses(addresses)
Return an iterator of the collapsed IPv4Network
or IPv6Network
objects. addresses is an iterator of IPv4Network
or IPv6Network
objects. A TypeError
is raised if addresses contains mixed version objects.
>>> [ipaddr for ipaddr in ... ipaddress.collapse_addresses([ipaddress.IPv4Network('192.0.2.0/25'), ... ipaddress.IPv4Network('192.0.2.128/25')])] [IPv4Network('192.0.2.0/24')]
Please login to continue.