tehmaze/ipcalc — Issue #4: Strange subnet calculations
Author: Michuelnik
Created: 2012-01-22 14:14:12+00:00
State: open

I think you are doing strange calculations. (You aren't doing things with binary (and,or,xor) operations?)
The three following examples are plain wrong.

Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipcalc
>>> ipcalc.__version__
'0.5'
>>> from ipcalc import Network
>>> n = Network("129.0.0.0/2")
>>> "128.0.0.0" in n
False
>>> n.in_network("128.0.0.1")
False
>>> "192.0.0.0" in n
True