Lines Matching refs:first
171 A tuple containing the first and last IP addresses in the sequence.
175 first = last = next(it)
178 yield first, last
179 first = ip
181 yield first, last
200 def summarize_address_range(first, last):
201 """Summarize a network range given the first and last IP addresses.
211 first: the first IPv4Address or IPv6Address in the range.
219 If the first and last objects are not IP addresses.
220 If the first and last objects are not the same version.
222 If the last object is not greater than the first.
223 If the version of the first address is not 4 or 6.
226 if (not (isinstance(first, _BaseAddress) and
228 raise TypeError('first and last must be IP addresses, not networks')
229 if first.version != last.version:
231 first, last))
232 if first > last:
233 raise ValueError('last IP address must be greater than first')
235 if first.version == 4:
237 elif first.version == 6:
242 ip_bits = first._max_prefixlen
243 first_int = first._ip
352 for first, last in _find_address_range(ips):
353 addrs.extend(summarize_address_range(first, last))