Skip to content

Commit 6293d8a

Browse files
mlnrtMatthieu LienartAA-Turner
authored
gh-136752: Clarify documentation for IPv{N}Address.is_reserved (#136794)
Co-authored-by: Matthieu Lienart <matthieu.lienart@axians.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 57acd65 commit 6293d8a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Doc/library/ipaddress.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,16 @@ write code that handles both IP versions correctly. Address objects are
240240

241241
.. attribute:: is_reserved
242242

243-
``True`` if the address is otherwise IETF reserved.
243+
``True`` if the address is noted as reserved by the IETF.
244+
For IPv4, this is only ``240.0.0.0/4``, the ``Reserved`` address block.
245+
For IPv6, this is all addresses `allocated <iana-ipv6-address-space_>`__ as
246+
``Reserved by IETF`` for future use.
247+
248+
.. note:: For IPv4, ``is_reserved`` is not related to the address block value of the
249+
``Reserved-by-Protocol`` column in iana-ipv4-special-registry_.
250+
251+
.. caution:: For IPv6, ``fec0::/10`` a former Site-Local scoped address prefix is
252+
currently excluded from that list (see :attr:`~IPv6Address.is_site_local` & :rfc:`3879`).
244253

245254
.. attribute:: is_loopback
246255

@@ -261,6 +270,7 @@ write code that handles both IP versions correctly. Address objects are
261270

262271
.. _iana-ipv4-special-registry: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
263272
.. _iana-ipv6-special-registry: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
273+
.. _iana-ipv6-address-space: https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml
264274

265275
.. method:: IPv4Address.__format__(fmt)
266276

0 commit comments

Comments
 (0)