From 812e582b684bffa0da68b12a5c42b9fd263c814c Mon Sep 17 00:00:00 2001 From: Jakub Stasiak Date: Fri, 15 Dec 2023 01:58:59 +0100 Subject: [PATCH] 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. --- Doc/library/ipaddress.rst | 4 +--- Lib/ipaddress.py | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Doc/library/ipaddress.rst b/Doc/library/ipaddress.rst index 1de36b643c4dca..b53a09d065ec10 100644 --- a/Doc/library/ipaddress.rst +++ b/Doc/library/ipaddress.rst @@ -320,9 +320,7 @@ write code that handles both IP versions correctly. Address objects are .. attribute:: is_site_local ``True`` if the address is reserved for site-local usage. Note that - the site-local address space has been deprecated by :RFC:`3879`. Use - :attr:`~IPv4Address.is_private` to test if this address is in the - space of unique local addresses as defined by :RFC:`4193`. + the site-local address space has been deprecated by :RFC:`3879`. .. attribute:: ipv4_mapped diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py index e398cc138308d9..5b5520b92bde28 100644 --- a/Lib/ipaddress.py +++ b/Lib/ipaddress.py @@ -2037,8 +2037,6 @@ def is_site_local(self): """Test if the address is reserved for site-local. Note that the site-local address space has been deprecated by RFC 3879. - Use is_private to test if this address is in the space of unique local - addresses as defined by RFC 4193. Returns: A boolean, True if the address is reserved per RFC 3513 2.5.6. @@ -2293,8 +2291,6 @@ def is_site_local(self): """Test if the address is reserved for site-local. Note that the site-local address space has been deprecated by RFC 3879. - Use is_private to test if this address is in the space of unique local - addresses as defined by RFC 4193. Returns: A boolean, True if the address is reserved per RFC 3513 2.5.6.