@@ -1339,17 +1339,15 @@ def is_reserved(self):
13391339 def is_private (self ):
13401340 """``True`` if the address is defined as not globally reachable by
13411341 iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_
1342- (for IPv6) with the following exceptions :
1342+ (for IPv6) with the following exception :
13431343
1344- * ``is_private`` is ``False`` for ``100.64.0.0/10``
1345- * For IPv4-mapped IPv6-addresses the ``is_private`` value is determined by the
1346- semantics of the underlying IPv4 addresses and the following condition holds
1347- (see :attr:`IPv6Address.ipv4_mapped`)::
1344+ For IPv4-mapped IPv6-addresses the ``is_private`` value is determined by the
1345+ semantics of the underlying IPv4 addresses and the following condition holds
1346+ (see :attr:`IPv6Address.ipv4_mapped`)::
13481347
1349- address.is_private == address.ipv4_mapped.is_private
1348+ address.is_private == address.ipv4_mapped.is_private
13501349
1351- ``is_private`` has value opposite to :attr:`is_global`, except for the ``100.64.0.0/10``
1352- IPv4 range where they are both ``False``.
1350+ ``is_private`` has value opposite to :attr:`is_global`.
13531351 """
13541352 return (
13551353 any (self in net for net in self ._constants ._private_networks )
@@ -1369,10 +1367,9 @@ def is_global(self):
13691367
13701368 address.is_global == address.ipv4_mapped.is_global
13711369
1372- ``is_global`` has value opposite to :attr:`is_private`, except for the ``100.64.0.0/10``
1373- IPv4 range where they are both ``False``.
1370+ ``is_global`` has value opposite to :attr:`is_private`.
13741371 """
1375- return self not in self . _constants . _public_network and not self .is_private
1372+ return not self .is_private
13761373
13771374 @property
13781375 def is_multicast (self ):
@@ -1571,9 +1568,7 @@ def is_global(self):
15711568 iana-ipv4-special-registry.
15721569
15731570 """
1574- return (not (self .network_address in IPv4Network ('100.64.0.0/10' ) and
1575- self .broadcast_address in IPv4Network ('100.64.0.0/10' )) and
1576- not self .is_private )
1571+ return not self .is_private
15771572
15781573
15791574class _IPv4Constants :
@@ -1583,13 +1578,12 @@ class _IPv4Constants:
15831578
15841579 _multicast_network = IPv4Network ('224.0.0.0/4' )
15851580
1586- _public_network = IPv4Network ('100.64.0.0/10' )
1587-
15881581 # Not globally reachable address blocks listed on
15891582 # https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
15901583 _private_networks = [
15911584 IPv4Network ('0.0.0.0/8' ),
15921585 IPv4Network ('10.0.0.0/8' ),
1586+ IPv4Network ('100.64.0.0/10' ),
15931587 IPv4Network ('127.0.0.0/8' ),
15941588 IPv4Network ('169.254.0.0/16' ),
15951589 IPv4Network ('172.16.0.0/12' ),
@@ -2085,17 +2079,15 @@ def is_site_local(self):
20852079 def is_private (self ):
20862080 """``True`` if the address is defined as not globally reachable by
20872081 iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_
2088- (for IPv6) with the following exceptions :
2082+ (for IPv6) with the following exception :
20892083
2090- * ``is_private`` is ``False`` for ``100.64.0.0/10``
2091- * For IPv4-mapped IPv6-addresses the ``is_private`` value is determined by the
2092- semantics of the underlying IPv4 addresses and the following condition holds
2093- (see :attr:`IPv6Address.ipv4_mapped`)::
2084+ For IPv4-mapped IPv6-addresses the ``is_private`` value is determined by the
2085+ semantics of the underlying IPv4 addresses and the following condition holds
2086+ (see :attr:`IPv6Address.ipv4_mapped`)::
20942087
2095- address.is_private == address.ipv4_mapped.is_private
2088+ address.is_private == address.ipv4_mapped.is_private
20962089
2097- ``is_private`` has value opposite to :attr:`is_global`, except for the ``100.64.0.0/10``
2098- IPv4 range where they are both ``False``.
2090+ ``is_private`` has value opposite to :attr:`is_global`.
20992091 """
21002092 ipv4_mapped = self .ipv4_mapped
21012093 if ipv4_mapped is not None :
@@ -2117,8 +2109,7 @@ def is_global(self):
21172109
21182110 address.is_global == address.ipv4_mapped.is_global
21192111
2120- ``is_global`` has value opposite to :attr:`is_private`, except for the ``100.64.0.0/10``
2121- IPv4 range where they are both ``False``.
2112+ ``is_global`` has value opposite to :attr:`is_private`.
21222113 """
21232114 return not self .is_private
21242115
0 commit comments