[Python-Dev] PEP 3144 review.

James Y Knight foom at fuhm.net
Sun Sep 27 21:40:22 CEST 2009

On Sep 27, 2009, at 3:18 PM, Peter Moody wrote:

> administrators) would use it, but it's doable. what you're claiming is
> that my use case is invalid.
> that's what I claim is broken.

He's claiming your solution to address your use case is confusing, not  
that the use case is invalid.

> I'm not going to make ipaddr
> less useful (strictly removing functionality), more bulky and
> confusing (adding more confusingly named classes and methods) or
> otherwise break the library in a vain attempt to have it included in
> the stdlib.

If I understand correctly, the proposal for addressing the issue is to  
make two rather simple changes:
1) if strict=False, mask off the bits described by the netmask when  
creating an IPNetwork, such that the host bits are always 0.
2) add a single new function:

def parse_net_and_addr(s):
   return (IPNetwork(s), IPAddress(s.split('/')[0]))


More information about the Python-Dev mailing list