Fix network handling.
Fixes:
-
is_subnet_ofwas broken if the supernet was not the network address. - Display now prints the network ip and not the ip used to construct the
IpNetwork. - Tests that were asserting against
.ip().
Adds:
- A regression test.
If there is no plans on breaking backwards compatibility, the ip() method should be re-introduced in my changes. Also, if ip is not kept, there would be no need for network() to compute the network address anymore as the arithmetic can be done in the constructor and the resulting ip stored in the struct, discarding the original IpAddr.
Sorry, it took me a while to reply, and thanks for the PR. I still have to figure out a good workflow of deprecating APIs and removing them eventually. Hence I am not a fan of changing the behaviour of ip right now.
@achanda I understand!
I'll update my PR with just the fix for is_subnet_of in the next few days then.
Probably superseded by #177.