'Called to implement membership test operators.
Should return true if item is in self, false otherwise. Item
can be other IP-objects, strings or ints.
>>> IP(\'195.185.1.1\').strHex()
\'0xc3b90101\'
>>> 0xC3B90101 in IP(\'195.185.1.0/24\')
True
>>> \'127.0.0.1\' in IP(\'127.0.0.0/24\')
True
>>> IP(\'127.0.0.0/24\') in IP(\'127.0.0.0/25\')
False'

def __contains__(self, item):

    if isinstance(item, IP):
        if (item._ipversion != self._ipversion):
            return False
    else:
        item = IP(item)
    if ((item.ip >= self.ip) and (item.ip < (((self.ip + self.len()) - item.len()) + 1))):
        return True
    else:
        return False
