This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kwi.dk
Recipients kwi.dk
Date 2014-11-25.16:41:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1416933717.58.0.234544639586.issue22941@psf.upfronthosting.co.za>
In-reply-to
Content
Addition and subtraction of integers are documented for ipaddress.IPv4Address and ipaddress.IPv6Address, but also work for IPv4Interface and IPv6Interface (though the only documentation of this is a brief mention that the Interface classes inherit from the respective Address classes). That's good.

The problem is that adding/subtracting an integer to an Interface object changes the subnet mask (to max_prefixlen), something which is 1) not documented and 2) not the least surprising result.

>>> import ipaddress
>>> ipaddress.IPv4Interface('10.0.0.1/8') + 1
IPv4Interface('10.0.0.2/32')
>>> ipaddress.IPv6Interface('fd00::1/64') + 1
IPv6Interface('fd00::2/128')

Changing this breaks backwards compatibility; though since the ipaddress module was provisional until recently and the behavior is undocumented, I hope it's not too late to change.
History
Date User Action Args
2014-11-25 16:41:57kwi.dksetrecipients: + kwi.dk
2014-11-25 16:41:57kwi.dksetmessageid: <1416933717.58.0.234544639586.issue22941@psf.upfronthosting.co.za>
2014-11-25 16:41:57kwi.dklinkissue22941 messages
2014-11-25 16:41:57kwi.dkcreate