A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2015-March/138784.html below:

[Python-Dev] Request for comments: [issue22941] IPv4Interface arithmetic changes subnet mask

[Python-Dev] Request for comments: [issue22941] IPv4Interface arithmetic changes subnet maskEric V. Smith eric at trueblade.com
Sat Mar 14 21:52:27 CET 2015
On 3/14/2015 7:04 AM, francis wrote:
> Hi,
>> I, too, was thinking /24. I think that overflowing the host portion
>> should raise OverflowError.
>>
> Just curiosity, why not a modulo calculation on the subnet instead
> of raising the error?

Personally, I can't imaging wanting that behavior. I can't say I've ever
needed additional at all with an IP address, but if I did, it would only
be to stay within the host portion. To wrap around seems odd. If you had
a /24 address and added 1000, should that really be the same as adding
232 (= 1000 % 256)? It seems more likely it's an error.

I'm +0 on adding addition with an OverflowError for the host portion,
and -1 on addition with modulo arithmetic.

-- 
Eric.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4