Skip to content

ipaddress: argument to collapse_addresses() should be described as iterable #120128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zuo opened this issue Jun 5, 2024 · 0 comments
Closed
Labels
docs Documentation in the Doc dir

Comments

@zuo
Copy link
Contributor

zuo commented Jun 5, 2024

Documentation

In the description of the `ipaddress.collapse_addresses() function, we can read that:

addresses is an iterator of IPv4Network or IPv6Network objects.

Whereas, in fact, addresses can be any iterable object (not necessarily an iterator).

Therefore, I propose to change that fragment to:

addresses is an iterable of IPv4Network or IPv6Network objects.

...and, also, to fix the related fragment of the function's docstring – by replacing: addresses: An iterator of IPv4Network or IPv6Network objects. with addresses: An iterable of IPv4Network or IPv6Network objects.

[Edit] PS Please note that even the already existing example in the docs (below the function's description) sets the addresses argument to an iterable (namely: a list), rather than an iterator.

Linked PRs

@zuo zuo added the docs Documentation in the Doc dir label Jun 5, 2024
@zuo zuo changed the title ipaddress: the argument to collapse_addresses() is described as an *iterator*, whereas any *iterable* is OK ipaddress: argument to collapse_addresses() should be described as *iterable* Jun 5, 2024
@zuo zuo changed the title ipaddress: argument to collapse_addresses() should be described as *iterable* ipaddress: argument to collapse_addresses() should be described as iterable Jun 5, 2024
zuo added a commit to zuo/cpython that referenced this issue Jun 5, 2024
…dresses()

The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
sobolevn pushed a commit that referenced this issue Jun 5, 2024
…s() (#120131)

The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 5, 2024
…dresses() (pythonGH-120131)

The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
(cherry picked from commit f878d46)

Co-authored-by: Jan Kaliszewski <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 5, 2024
…dresses() (pythonGH-120131)

The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
(cherry picked from commit f878d46)

Co-authored-by: Jan Kaliszewski <[email protected]>
sobolevn pushed a commit that referenced this issue Jun 12, 2024
…ddresses() (GH-120131) (#120135)

gh-120128: fix description of argument to ipaddress.collapse_addresses() (GH-120131)

The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
(cherry picked from commit f878d46)

Co-authored-by: Jan Kaliszewski <[email protected]>
hugovk pushed a commit that referenced this issue Jun 15, 2024
…ddresses() (GH-120131) (#120136)

gh-120128: fix description of argument to ipaddress.collapse_addresses() (GH-120131)

The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
(cherry picked from commit f878d46)

Co-authored-by: Jan Kaliszewski <[email protected]>
@hugovk hugovk closed this as completed Jun 15, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
…dresses() (python#120131)

The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…dresses() (python#120131)

The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants