MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / is_private

Method is_private

tools/python-3.11.9-amd64/Lib/ipaddress.py:2012–2024  ·  view source on GitHub ↗

Test if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per iana-ipv6-special-registry, or is ipv4_mapped and is reserved in the iana-ipv4-special-registry.

(self)

Source from the content-addressed store, hash-verified

2010 @property
2011 @functools.lru_cache()
2012 def is_private(self):
2013 """Test if this address is allocated for private networks.
2014
2015 Returns:
2016 A boolean, True if the address is reserved per
2017 iana-ipv6-special-registry, or is ipv4_mapped and is
2018 reserved in the iana-ipv4-special-registry.
2019
2020 """
2021 ipv4_mapped = self.ipv4_mapped
2022 if ipv4_mapped is not None:
2023 return ipv4_mapped.is_private
2024 return any(self in net for net in self._constants._private_networks)
2025
2026 @property
2027 def is_global(self):

Callers

nothing calls this directly

Calls 1

anyFunction · 0.70

Tested by

no test coverage detected