def bin(self):
        """Full-length binary representation of the IP address.

        >>> ip = IP("127.0.0.1")
        >>> print(ip.bin())
        01111111000000000000000000000001
        """
        bits = self.v == 4 and 32 or 128
        return bin(self.ip).split('b')[1].rjust(bits, '0')
Full-length binary representation of the IP address.

        >>> ip = IP("127.0.0.1")
        >>> print(ip.bin())
        01111111000000000000000000000001