Message290572
Looking into it, this appears to be a holdover from the original ipaddr design where rather than being modelled as separate objects, host interfaces are modelled as denormalised network objects (i.e. a host address with a netmask).
So the stdlib equivalent of the original ipaddr compare_networks() operation would be:
>>> ip_interface('192.0.2.1/31').network == ip_network('192.0.2.0/31')
True
As Sanjay noted, compare_networks() itself is fairly redundant given the stricter stdlib data model, since we don't allow the creation of denormalised network definitions in the first place:
```
>>> ip_network('192.0.2.1/31')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.5/ipaddress.py", line 74, in ip_network
return IPv4Network(address, strict)
File "/usr/lib64/python3.5/ipaddress.py", line 1536, in __init__
raise ValueError('%s has host bits set' % self)
ValueError: 192.0.2.1/31 has host bits set
``` |
|
Date |
User |
Action |
Args |
2017-03-27 09:44:12 | ncoghlan | set | recipients:
+ ncoghlan, pmoody, xiang.zhang, Sanjay |
2017-03-27 09:44:12 | ncoghlan | set | messageid: <1490607852.65.0.391933003449.issue29913@psf.upfronthosting.co.za> |
2017-03-27 09:44:12 | ncoghlan | link | issue29913 messages |
2017-03-27 09:44:12 | ncoghlan | create | |
|