def len(self):
        """Return the length of a subnet.

        >>> print(IP('195.185.1.0/28').len())
        16
        >>> print(IP('195.185.1.0/24').len())
        256
        """

        if self._ipversion == 4:
            locallen = self._prefixlen - 32
        elif self._ipversion == 6:
            locallen = 128 - self._prefixlen
        else:
            raise ValueError("only IPv4 and IPv6 supported")

        return 2 ** locallen
dataset/ETHPy150Open fp7-ofelia/ocf/ofam/src/src/foamext/IPy.py/IPint.len/swapped operands of `-`