'Called by comparison operations.
Should return a negative integer if self < other, zero if self
== other, a positive integer if self > other.
Networks with different prefixlen are considered non-equal.
Networks with the same prefixlen and differing addresses are
considered non equal but are compared by thair base address
integer value to aid sorting of IP objects.
The Version of Objects is not put into consideration.
>>> IP(\'10.0.0.0/24\') > IP(\'10.0.0.0\')
1
>>> IP(\'10.0.0.0/24\') < IP(\'10.0.0.0\')
0
>>> IP(\'10.0.0.0/24\') < IP(\'12.0.0.0/24\')
1
>>> IP(\'10.0.0.0/24\') > IP(\'12.0.0.0/24\')
0'

def __cmp__(self, other):

    if (self._prefixlen < other.prefixlen()):
        return (other.prefixlen() - self._prefixlen)
    elif (self._prefixlen > other.prefixlen()):
        return ((self._prefixlen - other.prefixlen()) * (-1))
    elif (self.ip < other.ip):
        return (-1)
    elif (self.ip > other.ip):
        return 1
    else:
        return 0
