-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
gh-120128: fix description of argument to ipaddress.collapse_addresses() #120131
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
Conversation
…dresses() The argument to collapse_addresses() is now described as an *iterable* (rather than *iterator*).
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
(For the record, I believe the change is too trivial to deserve a NEWS entry). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typeshed also defines this type as Iterable
: https://github.com/python/typeshed/blob/fd67f0a457a601ddb916dc35dfcdbda30b363f08/stdlib/ipaddress.pyi#L203
The only way addresses
is used is in for
loop, so I guess it is fine to make the input type wider. Moreover, even the given example conradicts the description:
Example:
collapse_addresses([IPv4Network('192.0.2.0/25'),
IPv4Network('192.0.2.128/25')]) ->
[IPv4Network('192.0.2.0/24')]
Args:
addresses: An iterator of IPv4Network or IPv6Network objects.
since list
is not an iterator
.
Thanks!
I also agree that the NEWS entry is not needed. This is a doc only change.
…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]>
GH-120135 is a backport of this pull request to the 3.13 branch. |
…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]>
GH-120136 is a backport of this pull request to the 3.12 branch. |
|
…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]>
|
…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]>
…dresses() (python#120131) The argument to collapse_addresses() is now described as an *iterable* (rather than *iterator*).
…dresses() (python#120131) The argument to collapse_addresses() is now described as an *iterable* (rather than *iterator*).
The argument to collapse_addresses() is now described as an iterable (rather than iterator).
ipaddress
: argument tocollapse_addresses()
should be described as iterable #120128📚 Documentation preview 📚: https://cpython-previews--120131.org.readthedocs.build/