def __init__(self, address, strict=False):
        """Instantiate a new IPv6 network object.

        Args:
            address: The IPv6 network as a string, 2-tuple, or any format
              supported by the IPv6Address constructor.

              Strings should be in CIDR format, such as '2001:db8::/32'.

              The 2-tuple format consists of an (ip, prefixlen), where ip is any
              format recognized by the IPv6Address constructor, and prefixlen is
              an integer from 0 through 128.

              A plain IPv6 address (in any format) will be forwarded to the
              IPv6Address constructor, with an implied prefixlen of 128.

              For example, the following inputs are equivalent:
                IPv6Network('2001:db8::/128')
                IPv6Network('2001:db8:0:0:0:0:0:0/128')
                IPv6Network('2001:db8::')
                IPv6Network(0x20010db8 << 96)
                IPv6Network(IPv6Address('2001:db8::'))
                IPv6Network(('2001:db8::', 128))
                IPv6Network((0x20010db8 << 96, 128))
                IPv6Network((IPv6Address('2001:db8::'), 128))

            strict: A boolean. If true, ensure that we have been passed
              A true network address, eg, 2001:db8::/32 and not an
              IP address on a network, eg, 2001:db8::1/32.

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv6 address.
            ValueError: If strict was True and a network address was not
              supplied.

        """
        _BaseNet.__init__(self, address)
        _BaseV6.__init__(self, address)

        # Constructing from a single IP address.
        if isinstance(address, (int, long, Bytes, IPv6Address)):
            self.ip = IPv6Address(address)
            self._ip = self.ip._ip
            self._prefixlen = self._max_prefixlen
            self.netmask = IPv6Address(self._ALL_ONES)
            return

        # Constructing from an (ip, prefixlen) tuple.
        if isinstance(address, tuple):
            try:
                ip, prefixlen = address
            except ValueError:
                raise AddressValueError(address)
            self.ip = IPv6Address(ip)
            self._ip = self.ip._ip
            self._prefixlen = self._prefix_from_prefix_int(prefixlen)

        else:
            # Assume input argument to be string or any object representation
            # which converts into a formatted IP prefix string.
            addr = str(address).split('/')

            if len(addr) > 2:
                raise AddressValueError(address)

            self._ip = self._ip_int_from_string(addr[0])
            self.ip = IPv6Address(self._ip)

            if len(addr) == 2:
                # This may raise NetmaskValueError
                self._prefixlen = self._prefix_from_prefix_string(addr[1])
            else:
                self._prefixlen = self._max_prefixlen

        self.netmask = IPv6Address(self._ip_int_from_prefix(self._prefixlen))

        if strict:
            if self.ip != self.network:
                raise ValueError('%s has host bits set' %
                                 self.ip)
        if self._prefixlen == (self._max_prefixlen - 1):
            self.iterhosts = self.__iter__
def __init__ ( self , address , strict = False ) : _BaseNet . __init__ ( self , address ) _BaseV6 . __init__ ( self , address ) if isinstance ( address , ( int , long , Bytes , IPv6Address ) ) : self . ip = IPv6Address ( address ) self . _ip = self . ip . _ip self . _prefixlen = self . _max_prefixlen self . netmask = IPv6Address ( self . _ALL_ONES ) return if isinstance ( address , tuple ) : try : ip , prefixlen = address except ValueError : raise AddressValueError ( address ) self . ip = IPv6Address ( ip ) self . _ip = self . ip . _ip self . _prefixlen = self . _prefix_from_prefix_int ( prefixlen ) else : addr = str ( address ) . split ( '/' ) if len ( addr ) > 2 : raise AddressValueError ( address ) self . _ip = self . _ip_int_from_string ( addr [ 0 ] ) self . ip = IPv6Address ( self . _ip ) if len ( addr ) == 2 : self . _prefixlen = self . _prefix_from_prefix_string ( addr [ 1 ] ) else : self . _prefixlen = self . _max_prefixlen self . netmask = IPv6Address ( self . _ip_int_from_prefix ( self . _prefixlen ) ) if strict : if self . ip != self . network : raise ValueError ( '%s has host bits set' % self . ip ) if self . _prefixlen == ( self . _max_prefixlen - 1 ) : self . iterhosts = self . __iter__
Instantiate a new IPv6 network object.

        Args:
            address: The IPv6 network as a string, 2-tuple, or any format
              supported by the IPv6Address constructor.

              Strings should be in CIDR format, such as '2001:db8::/32'.

              The 2-tuple format consists of an (ip, prefixlen), where ip is any
              format recognized by the IPv6Address constructor, and prefixlen is
              an integer from 0 through 128.

              A plain IPv6 address (in any format) will be forwarded to the
              IPv6Address constructor, with an implied prefixlen of 128.

              For example, the following inputs are equivalent:
                IPv6Network('2001:db8::/128')
                IPv6Network('2001:db8:0:0:0:0:0:0/128')
                IPv6Network('2001:db8::')
                IPv6Network(0x20010db8 << 96)
                IPv6Network(IPv6Address('2001:db8::'))
                IPv6Network(('2001:db8::', 128))
                IPv6Network((0x20010db8 << 96, 128))
                IPv6Network((IPv6Address('2001:db8::'), 128))

            strict: A boolean. If true, ensure that we have been passed
              A true network address, eg, 2001:db8::/32 and not an
              IP address on a network, eg, 2001:db8::1/32.

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv6 address.
            ValueError: If strict was True and a network address was not
              supplied.