def address_exclude(self, other):
if not self._version == other._version:<EOL><INDENT>raise TypeError("<STR_LIT>" % (<EOL>self, other))<EOL><DEDENT>if not isinstance(other, _BaseNetwork):<EOL><INDENT>raise TypeError("<STR_LIT>" % other)<EOL><DEDENT>if not other.subnet_of(self):<EOL><INDENT>raise ValueError('<STR_LIT>' % (other, self))<EOL><DEDENT>if other == self:<EOL><INDENT>return<EOL><DEDENT>other = other.__class__('<STR_LIT>' % (other.network_address,<EOL>other.prefixlen))<EOL>s1, s2 = self.subnets()<EOL>while s1 != other and s2 != other:<EOL><INDENT>if other.subnet_of(s1):<EOL><INDENT>yield s2<EOL>s1, s2 = s1.subnets()<EOL><DEDENT>elif other.subnet_of(s2):<EOL><INDENT>yield s1<EOL>s1, s2 = s2.subnets()<EOL><DEDENT>else:<EOL><INDENT>raise AssertionError('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(s1, s2, other))<EOL><DEDENT><DEDENT>if s1 == other:<EOL><INDENT>yield s2<EOL><DEDENT>elif s2 == other:<EOL><INDENT>yield s1<EOL><DEDENT>else:<EOL><INDENT>raise AssertionError('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(s1, s2, other))<EOL><DEDENT>
Remove an address from a larger block.

        For example:

            addr1 = ip_network('192.0.2.0/28')
            addr2 = ip_network('192.0.2.1/32')
            list(addr1.address_exclude(addr2)) =
                [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/31'),
                 IPv4Network('192.0.2.4/30'), IPv4Network('192.0.2.8/29')]

        or IPv6:

            addr1 = ip_network('2001:db8::1/32')
            addr2 = ip_network('2001:db8::1/128')
            list(addr1.address_exclude(addr2)) =
                [ip_network('2001:db8::1/128'),
                 ip_network('2001:db8::2/127'),
                 ip_network('2001:db8::4/126'),
                 ip_network('2001:db8::8/125'),
                 ...
                 ip_network('2001:db8:8000::/33')]

        Args:
            other: An IPv4Network or IPv6Network object of the same type.

        Returns:
            An iterator of the IPv(4|6)Network objects which is self
            minus other.

        Raises:
            TypeError: If self and other are of differing address
              versions, or if other is not a network object.
            ValueError: If other is not completely contained by self.