MCPcopy Index your code
hub / github.com/python/cpython / _find_address_range

Function _find_address_range

Lib/ipaddress.py:161–178  ·  view source on GitHub ↗

Find a sequence of sorted deduplicated IPv#Address. Args: addresses: a list of IPv#Address objects. Yields: A tuple containing the first and last IP addresses in the sequence.

(addresses)

Source from the content-addressed store, hash-verified

159
160
161def _find_address_range(addresses):
162 """Find a sequence of sorted deduplicated IPv#Address.
163
164 Args:
165 addresses: a list of IPv#Address objects.
166
167 Yields:
168 A tuple containing the first and last IP addresses in the sequence.
169
170 """
171 it = iter(addresses)
172 first = last = next(it)
173 for ip in it:
174 if ip._ip != last._ip + 1:
175 yield first, last
176 first = ip
177 last = ip
178 yield first, last
179
180
181def _count_righthand_zero_bits(number, bits):

Callers 1

collapse_addressesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…