-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
gh-141497: make ipaddress.IP{v4,v6}Network.hosts() return an iterator
#141547
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
base: main
Are you sure you want to change the base?
Conversation
dr-carlos
left a comment
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.
A short test should be added in the relevant part(s) of test_ipaddress.py to ensure that the hosts() method always returns an iterator.
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.
The tests looks good, but this should still pass on main. Could you add similar tests for the specific cases affected by this PR?
cpython/Lib/test/test_ipaddress.py
Lines 1507 to 1510 in 17a1a05
| # special case where the network is a /32 | |
| addrs = [ipaddress.IPv4Address('1.2.3.4')] | |
| str_args = '1.2.3.4/32' | |
| tpl_args = ('1.2.3.4', 32) |
cpython/Lib/test/test_ipaddress.py
Lines 1525 to 1527 in 17a1a05
| addrs = [ipaddress.IPv6Address('2001:658:22a:cafe::1'), ] | |
| str_args = '2001:658:22a:cafe::1/128' | |
| tpl_args = ('2001:658:22a:cafe::1', 128) |
the workflow shows an error in test import, I think it is a known issue I saw it somewhere.... |
sharktide
left a comment
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.
LGTM
sharktide
left a comment
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.
Although we probably should re-run the failed test. It seems unrelated.
|
Is there a way to rerun the workflow?? I don't see any in checks |
You can't, a core developer or official triager has to. I am not officially either. It is fine for now. They probably will when they see this PR of you haven't pushed any commits in the meantime because losing commits re-runs all tests. |
sharktide
left a comment
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.
Core review? @serhiy-storchaka
iterableipaddress.IPv4Network.hosts() an iterable
ipaddress.IPv4Network.hosts() an iterableipaddress.IP{v4,v6}Network.hosts() an iterable
ipaddress.IP{v4,v6}Network.hosts() an iterableipaddress.IP{v4,v6}Network.hosts() return an iterator
Misc/NEWS.d/next/Library/2025-11-14-16-24-20.gh-issue-141497.L_CxDJ.rst
Outdated
Show resolved
Hide resolved
Misc/NEWS.d/next/Library/2025-11-14-16-24-20.gh-issue-141497.L_CxDJ.rst
Outdated
Show resolved
Hide resolved
Misc/NEWS.d/next/Library/2025-11-14-16-24-20.gh-issue-141497.L_CxDJ.rst
Outdated
Show resolved
Hide resolved
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
picnixz
left a comment
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.
Sorry my previous was incomplete but I was on mobile.
Uh oh!
There was an error while loading. Please reload this page.