Skip to content

Commit c0fed91

Browse files
authored
Fix ipaddress._BaseNetwork.hosts return type (#14658)
Both `IPv4Network` and `IPv6Network` can return a single-element list instead of iterator.
1 parent 6ab603f commit c0fed91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/ipaddress.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class _BaseNetwork(_IPAddressBase, Generic[_A]):
7373
@property
7474
def broadcast_address(self) -> _A: ...
7575
def compare_networks(self, other: Self) -> int: ...
76-
def hosts(self) -> Iterator[_A]: ...
76+
def hosts(self) -> Iterator[_A] | list[_A]: ...
7777
@property
7878
def is_global(self) -> bool: ...
7979
@property

0 commit comments

Comments
 (0)