Neel
Neel

Reputation: 21315

netaddr remove `is_private` method from BaseIP class in new version

I was using netaddr version 0.10.1, and its BaseIP class has method is_private. We are using that method as if mynetwork.is_private(): # DO SOMETHING.

Now we upgrade netaddr package to 1.2.1. In this new upgrade, BaseIP has no method call is_private. even IPV4_PRIVATEISH and IPV6_PRIVATEISH was removed.

I want to check is there any other method available which we can use for is_private? I tried if mynetwork in IPV4_PRIVATE_USE: # DO SOMETHING but this doesn't cover all cases covered by is_private method in 0.10.1.

Let me know if there is pythonic way to implement this is_private logic again.

Upvotes: 0

Views: 114

Answers (0)

Related Questions