From: Jan Kaliszewski Date: Wed, 5 Jun 2024 21:52:40 +0000 (+0200) Subject: gh-120128: fix description of argument to ipaddress.collapse_addresses() (#120131) X-Git-Tag: v3.14.0a1~1587 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f878d46e5614f08a9302fcb6fc611ef49e9acf2f;p=thirdparty%2FPython%2Fcpython.git gh-120128: fix description of argument to ipaddress.collapse_addresses() (#120131) The argument to collapse_addresses() is now described as an *iterable* (rather than *iterator*). --- diff --git a/Doc/library/ipaddress.rst b/Doc/library/ipaddress.rst index ead841b0581e..f58c0ea75a47 100644 --- a/Doc/library/ipaddress.rst +++ b/Doc/library/ipaddress.rst @@ -990,7 +990,7 @@ The module also provides the following module level functions: .. function:: collapse_addresses(addresses) Return an iterator of the collapsed :class:`IPv4Network` or - :class:`IPv6Network` objects. *addresses* is an iterator of + :class:`IPv6Network` objects. *addresses* is an :term:`iterable` of :class:`IPv4Network` or :class:`IPv6Network` objects. A :exc:`TypeError` is raised if *addresses* contains mixed version objects. diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py index 8e4d49c85953..9cef275f7ae2 100644 --- a/Lib/ipaddress.py +++ b/Lib/ipaddress.py @@ -310,7 +310,7 @@ def collapse_addresses(addresses): [IPv4Network('192.0.2.0/24')] Args: - addresses: An iterator of IPv4Network or IPv6Network objects. + addresses: An iterable of IPv4Network or IPv6Network objects. Returns: An iterator of the collapsed IPv(4|6)Network objects.