Skip to content

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

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

zuo
Copy link
Contributor

@zuo zuo commented Jun 5, 2024

The argument to collapse_addresses() is now described as an iterable (rather than iterator).


📚 Documentation preview 📚: https://cpython-previews--120131.org.readthedocs.build/

…dresses()

The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
@ghost
Copy link

ghost commented Jun 5, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Jun 5, 2024

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 skip news label instead.

@zuo
Copy link
Contributor Author

zuo commented Jun 5, 2024

(For the record, I believe the change is too trivial to deserve a NEWS entry).

Copy link
Member

@sobolevn sobolevn left a 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.

@sobolevn sobolevn added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Jun 5, 2024
@sobolevn sobolevn merged commit f878d46 into python:main Jun 5, 2024
40 checks passed
@miss-islington-app
Copy link

Thanks @zuo for the PR, and @sobolevn for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request 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]>
@bedevere-app
Copy link

bedevere-app bot commented Jun 5, 2024

GH-120135 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jun 5, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request 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]>
@bedevere-app
Copy link

bedevere-app bot commented Jun 5, 2024

GH-120136 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Jun 5, 2024
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 Fedora Stable Clang 3.x has failed when building commit f878d46.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/234/builds/6077) and take a look at the build logs.
  4. Check if the failure is related to this commit (f878d46) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/234/builds/6077

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang/build/Lib/threading.py", line 1039, in _bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang/build/Lib/threading.py", line 990, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang/build/Lib/test/test_interpreters/test_stress.py", line 29, in task
    interp = interpreters.create()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang/build/Lib/test/support/interpreters/__init__.py", line 76, in create
    id = _interpreters.create(reqrefs=True)
interpreters.InterpreterError: interpreter creation failed
k

sobolevn pushed a commit that referenced this pull request 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]>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable LTO + PGO 3.13 has failed when building commit 8f5ce42.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1426/builds/107) and take a look at the build logs.
  4. Check if the failure is related to this commit (8f5ce42) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1426/builds/107

Summary of the results of the build (if available):

Click to see traceback logs
remote: Enumerating objects: 7, done.        
remote: Counting objects:  14% (1/7)        
remote: Counting objects:  28% (2/7)        
remote: Counting objects:  42% (3/7)        
remote: Counting objects:  57% (4/7)        
remote: Counting objects:  71% (5/7)        
remote: Counting objects:  85% (6/7)        
remote: Counting objects: 100% (7/7)        
remote: Counting objects: 100% (7/7), done.        
remote: Compressing objects:  20% (1/5)        
remote: Compressing objects:  40% (2/5)        
remote: Compressing objects:  60% (3/5)        
remote: Compressing objects:  80% (4/5)        
remote: Compressing objects: 100% (5/5)        
remote: Compressing objects: 100% (5/5), done.        
remote: Total 7 (delta 2), reused 3 (delta 2), pack-reused 0        
From https://github.com/python/cpython
 * branch                  3.13       -> FETCH_HEAD
Note: switching to '8f5ce42f3418dfcc37232390ba89c33b9c9ffb13'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 8f5ce42f34 [3.13] gh-120128: fix description of argument to ipaddress.collapse_addresses() (GH-120131) (#120135)
Switched to and reset branch '3.13'

configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)

find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make[2]: [Makefile:3121: clean-retain-profile] Error 1 (ignored)
ar: unable to copy file 'libpython3.13.a'; reason: No space left on device
make[2]: *** [Makefile:1047: libpython3.13.a] Error 1
make[1]: *** [Makefile:877: profile-gen-stamp] Error 2
make: *** [Makefile:889: profile-run-stamp] Error 2

hugovk pushed a commit that referenced this pull request 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]>
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request 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 pull request 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants