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)
| 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): |