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

Method _is_subnet_of

Lib/ipaddress.py:1031–1040  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

1029
1030 @staticmethod
1031 def _is_subnet_of(a, b):
1032 try:
1033 # Always false if one is v4 and the other is v6.
1034 if a.version != b.version:
1035 raise TypeError(f"{a} and {b} are not of the same version")
1036 return (b.network_address <= a.network_address and
1037 b.broadcast_address >= a.broadcast_address)
1038 except AttributeError:
1039 raise TypeError(f"Unable to test subnet containment "
1040 f"between {a} and {b}")
1041
1042 def subnet_of(self, other):
1043 """Return True if this network is a subnet of other."""

Callers 2

subnet_ofMethod · 0.95
supernet_ofMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected