Visitar URL original
ip_interface addition and subtraction changes netmask · Issue #86643 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20261021135539/https://github.com/python/cpython/issues/86643
Skip to content

ip_interface addition and subtraction changes netmask #86643

Open

Description

@wykoterhaar
BPO 42477

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2020-11-26.23:14:01.991>
labels = ['type-bug', 'library', '3.10']
title = 'ip_interface addition and subtraction changes netmask'
updated_at = <Date 2020-11-28.20:04:31.585>
user = 'https://bugs.python.org/wykoterhaar'

bugs.python.org fields:

activity = <Date 2020-11-28.20:04:31.585>
actor = 'epaine'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2020-11-26.23:14:01.991>
creator = 'wyko.ter.haar'
dependencies = []
files = []
hgrepos = []
issue_num = 42477
keywords = []
message_count = 1.0
messages = ['381918']
nosy_count = 2.0
nosy_names = ['pmoody', 'wyko.ter.haar']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue42477'
versions = ['Python 3.10']

Activity

  1. wykoterhaar commented on Nov 26, 2020

    wykoterhaarmannequin
    MannequinAuthor

    When increasing IPv4Interface('10.0.0.0/29)' by 1, I would expect to get IPv4Interface('10.0.0.1/29') . Unfortunately, it seems to change the netmask on it as well. That seems really unintuitive to me.

    For example:
    >>> ip_interface('10.0.0.0/24')
    IPv4Interface('10.0.0.0/24')
    >>>
    >>> ip_interface('10.0.0.0/24')+1
    IPv4Interface('10.0.0.1/32')
  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    and removed on Nov 28, 2020
  3. transferred this issue fromon Apr 10, 2022
  4. MorningLightMountain713 commented on Mar 31, 2025

    @MorningLightMountain713

    Any movement on this?

    I can see it was raised back in 2014:
    https://bugs.python.org/issue22941

    This is quite a glaring bug...

  5. picnixz commented on Mar 31, 2025

    @picnixz
    Member

    How are arithmetic operations defined for IP addresses in general? is there an RFC that mandates how to do it?

  6. vasiliyk commented on Oct 17, 2026

    @vasiliyk
    Contributor

    Duplicate of gh-67130 (2014). I suggest closing this and gh-88152 in favor of that one.
    I've posted a proposal and offered a PR there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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