-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Incomplete return type for ipaddress.IPv4Network.hosts() #141497
Copy link
Copy link
Closed
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Todo
Documentation
(And also for ipaddress.IPv6Network.hosts())
In https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Network.hosts and https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv6Network.hosts the
hosts()method is documented as returning an iterator, when in reality it can return an iterator or a list.This extra return possibilty can be seen in
cpython/Lib/ipaddress.py
Line 1549 in 781cc68
cpython/Lib/ipaddress.py
Line 2340 in 781cc68
and was introduced in 2020 in 8e9c47a, but was fixed only recently in typeshed: python/typeshed@c0fed91
Linked PRs
ipaddress.IP{v4,v6}Network.hosts()return an iterator #141547ipaddress.IP{v4,v6}Network.hosts()return an iterator (GH-141547) #141695