'Return the length of a subnet.
>>> print(IP(\'195.185.1.0/28\').len())
16
>>> print(IP(\'195.185.1.0/24\').len())
256'

def len(self):

    bits = _ipVersionToLen(self._ipversion)
    locallen = (bits - self._prefixlen)
    return (2 ** locallen)
