ipnetwork icon indicating copy to clipboard operation
ipnetwork copied to clipboard

Fix network handling.

Open Barre opened this issue 6 years ago • 3 comments

Fixes:

  • is_subnet_of was 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.

Barre avatar Jan 11 '20 16:01 Barre

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 avatar Jan 18 '20 11:01 achanda

@achanda I understand!

I'll update my PR with just the fix for is_subnet_of in the next few days then.

Barre avatar Jan 18 '20 11:01 Barre

Probably superseded by #177.

ctrlcctrlv avatar Jun 13 '23 18:06 ctrlcctrlv