You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incomplete return type for ipaddress.IPv4Network.hosts() #141497
Activity
serhiy-storchaka commentedon Nov 13, 2025
Returning an iterator or a list looks bad design. It should either always return an iterator (so
next()works) or a re-iterable iterable.I think that we can consider 8e9c47a introducing a bug.
hostsshould return not[IPv4Address(addr)], butiter([IPv4Address(addr)]).XChaitanyaX commentedon Nov 14, 2025
working on this...
gh-141497: Make ipaddress.IP{v4,v6}Network.hosts() always returning a…
pythongh-141497: Make ipaddress.IP{v4,v6}Network.hosts() always retur…
[3.14] gh-141497: Make ipaddress.IP{v4,v6}Network.hosts() always retu…
[3.13] gh-141497: Make ipaddress.IP{v4,v6}Network.hosts() always retu…
serhiy-storchaka commentedon Nov 18, 2025
Thank you for your report @elWanderero and your PR @XChaitanyaX.
I guess typeshed should fix this back.
Remove `list` return type from `_BaseNetwork.hosts`
Remove `list` return type from `_BaseNetwork.hosts` (#15047)
pythongh-141497: Make ipaddress.IP{v4,v6}Network.hosts() always retur…