compare_networks(other)
Compare this network to other. In this comparison only the network addresses are considered; host bits aren’t. Returns either -1
, 0
or 1
.
>>> ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.2/32')) -1 >>> ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.0/32')) 1 >>> ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.1/32')) 0
Please login to continue.