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