Skip to content

Commit 812e582

Browse files
committed
Remove misleading parts of is_site_local() documentation
In case of IPv6Address and IPv6Network is_private is very much not an equivalent or a replacement of is_site_local(). IPv6 is_private considers many ranges other than RFC 4193's fc00::/7 to be private (see _IPv6Constants._private_networks for the complete list). IPv6Address.is_private goes even further and delegates to IPv4Address.is_private in case of an IPv4-mapped IPv6 address.
1 parent f34e22c commit 812e582

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

Doc/library/ipaddress.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,7 @@ write code that handles both IP versions correctly. Address objects are
320320
.. attribute:: is_site_local
321321

322322
``True`` if the address is reserved for site-local usage. Note that
323-
the site-local address space has been deprecated by :RFC:`3879`. Use
324-
:attr:`~IPv4Address.is_private` to test if this address is in the
325-
space of unique local addresses as defined by :RFC:`4193`.
323+
the site-local address space has been deprecated by :RFC:`3879`.
326324

327325
.. attribute:: ipv4_mapped
328326

Lib/ipaddress.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2037,8 +2037,6 @@ def is_site_local(self):
20372037
"""Test if the address is reserved for site-local.
20382038
20392039
Note that the site-local address space has been deprecated by RFC 3879.
2040-
Use is_private to test if this address is in the space of unique local
2041-
addresses as defined by RFC 4193.
20422040
20432041
Returns:
20442042
A boolean, True if the address is reserved per RFC 3513 2.5.6.
@@ -2293,8 +2291,6 @@ def is_site_local(self):
22932291
"""Test if the address is reserved for site-local.
22942292
22952293
Note that the site-local address space has been deprecated by RFC 3879.
2296-
Use is_private to test if this address is in the space of unique local
2297-
addresses as defined by RFC 4193.
22982294
22992295
Returns:
23002296
A boolean, True if the address is reserved per RFC 3513 2.5.6.

0 commit comments

Comments
 (0)