Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Incomplete return type for ipaddress.IPv4Network.hosts() #141497

Closed
Assignees
XChaitanyaX
Labels
3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@elWanderero

Description

@elWanderero

Documentation

(And also for ipaddress.IPv6Network.hosts())

Inhttps://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Network.hosts andhttps://docs.python.org/3/library/ipaddress.html#ipaddress.IPv6Network.hosts thehosts() method is documented as returning an iterator, when in reality it can return an iteratoror a list.

This extra return possibilty can be seen in

self.hosts=lambda: [IPv4Address(addr)]
and
self.hosts=lambda: [IPv6Address(addr)]

and was introduced in 2020 in8e9c47a, but was fixed only recently in typeshed:python/typeshed@c0fed91

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp