On Thu, 12 Mar 2015 14:08:01 -0400
Scott Dial <scott+python-...@scottdial.com> wrote:

> On 2015-03-12 10:46 AM, Eric V. Smith wrote:
> > On 3/12/2015 10:00 AM, Antoine Pitrou wrote:
> >> Related issue:
> >>
> >>>>> ipaddress.IPv4Interface('10.0.0.255/8') + 1
> >> IPv4Interface('10.0.1.0/32')
> >>
> >> Should the result be IPv4Interface('10.0.0.0/8')
> >> (i.e. wrap around)? Should OverflowError be raised?
> > 
> > I think it should be an OverflowError. 10.0.1.0/8 makes no sense, and
> > 10.0.0.0/8 is unlikely to be desirable.
> > 
> 
> No, you are both imbuing meaning to the dot-notation that is not there.
> A.B.C.D is just an ugly way to represent a single 32-bit unsigned
> integer. The only contentious part would be when your addition would
> overlfow the host-portion of the address:
> 
> >>> ipaddress.IPv4Interface('10.255.255.255/8') + 1
> IPv4Interface('11.0.0.0/8')

Oh, well, you're right, I borked my subnet. So, for the record, I meant
"10.0.0.255/24" where the issue actually appears.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to