@@ -1339,17 +1339,15 @@ def is_reserved(self):
1339
1339
def is_private (self ):
1340
1340
"""``True`` if the address is defined as not globally reachable by
1341
1341
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 :
1343
1343
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`)::
1348
1347
1349
- address.is_private == address.ipv4_mapped.is_private
1348
+ address.is_private == address.ipv4_mapped.is_private
1350
1349
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`.
1353
1351
"""
1354
1352
return (
1355
1353
any (self in net for net in self ._constants ._private_networks )
@@ -1369,10 +1367,9 @@ def is_global(self):
1369
1367
1370
1368
address.is_global == address.ipv4_mapped.is_global
1371
1369
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`.
1374
1371
"""
1375
- return self not in self . _constants . _public_network and not self .is_private
1372
+ return not self .is_private
1376
1373
1377
1374
@property
1378
1375
def is_multicast (self ):
@@ -1571,9 +1568,7 @@ def is_global(self):
1571
1568
iana-ipv4-special-registry.
1572
1569
1573
1570
"""
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
1577
1572
1578
1573
1579
1574
class _IPv4Constants :
@@ -1583,13 +1578,12 @@ class _IPv4Constants:
1583
1578
1584
1579
_multicast_network = IPv4Network ('224.0.0.0/4' )
1585
1580
1586
- _public_network = IPv4Network ('100.64.0.0/10' )
1587
-
1588
1581
# Not globally reachable address blocks listed on
1589
1582
# https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
1590
1583
_private_networks = [
1591
1584
IPv4Network ('0.0.0.0/8' ),
1592
1585
IPv4Network ('10.0.0.0/8' ),
1586
+ IPv4Network ('100.64.0.0/10' ),
1593
1587
IPv4Network ('127.0.0.0/8' ),
1594
1588
IPv4Network ('169.254.0.0/16' ),
1595
1589
IPv4Network ('172.16.0.0/12' ),
@@ -2085,17 +2079,15 @@ def is_site_local(self):
2085
2079
def is_private (self ):
2086
2080
"""``True`` if the address is defined as not globally reachable by
2087
2081
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 :
2089
2083
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`)::
2094
2087
2095
- address.is_private == address.ipv4_mapped.is_private
2088
+ address.is_private == address.ipv4_mapped.is_private
2096
2089
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`.
2099
2091
"""
2100
2092
ipv4_mapped = self .ipv4_mapped
2101
2093
if ipv4_mapped is not None :
@@ -2117,8 +2109,7 @@ def is_global(self):
2117
2109
2118
2110
address.is_global == address.ipv4_mapped.is_global
2119
2111
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`.
2122
2113
"""
2123
2114
return not self .is_private
2124
2115
0 commit comments