Skip to content

ipaddress.IPv6Interface.is_unspecified is False for IPv4-mapped ::ffff:0.0.0.0 #161100

Closed

Description

@gpshead

Bug report

Bug description:

IPv6Interface.is_unspecified is False for the IPv4-mapped address ::ffff:0.0.0.0, even though the interface's own .ip and .network both say True. gh-122792 made IPv6Address.is_unspecified follow the mapped IPv4 address, but the IPv6Interface override still compares the raw integer with 0 instead of deferring to super() the way is_loopback does since gh-117566.

>>> import ipaddress
>>> i = ipaddress.ip_interface('::ffff:0.0.0.0')
>>> i.is_unspecified, i.ip.is_unspecified, i.network.is_unspecified
(False, True, True)
>>> ipaddress.ip_interface('0.0.0.0').is_unspecified
True

Expected True, matching ip_address('::ffff:0.0.0.0').is_unspecified and ip_interface('0.0.0.0').is_unspecified.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. self-assigned this
    on Nov 1, 2026
  2. added
    type-bugAn unexpected behavior, bug, or error
    stdlibStandard Library Python modules in the Lib/ directory
    on Nov 1, 2026
  3. added a commit that references this issue on Nov 1, 2026
  4. added a commit that references this issue on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions