(a, b)
| 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.""" |
no outgoing calls
no test coverage detected