MCPcopy Index your code
hub / github.com/RustPython/RustPython / is_private

Method is_private

Lib/ipaddress.py:1074–1088  ·  view source on GitHub ↗

Test if this network belongs to a private range. Returns: A boolean, True if the network is reserved per iana-ipv4-special-registry or iana-ipv6-special-registry.

(self)

Source from the content-addressed store, hash-verified

1072
1073 @property
1074 def is_private(self):
1075 """Test if this network belongs to a private range.
1076
1077 Returns:
1078 A boolean, True if the network is reserved per
1079 iana-ipv4-special-registry or iana-ipv6-special-registry.
1080
1081 """
1082 return any(self.network_address in priv_network and
1083 self.broadcast_address in priv_network
1084 for priv_network in self._constants._private_networks) and all(
1085 self.network_address not in network and
1086 self.broadcast_address not in network
1087 for network in self._constants._private_networks_exceptions
1088 )
1089
1090 @property
1091 def is_global(self):

Callers

nothing calls this directly

Calls 2

allFunction · 0.85
anyFunction · 0.70

Tested by

no test coverage detected