[Python-Dev] PEP 3144 review. (original) (raw)

Nick Coghlan ncoghlan at gmail.com
Mon Sep 28 13:58:22 CEST 2009


Peter Moody wrote:

Assuming the Network type loses the notion of a specific host (or host address, or ip) attached to it, yes. this is "less useful (strictly removing functionality)" and is an example of what I explicitly said I was not going to do with ipaddr.

A possible compromise then:

Just change the definition of network equality to only consider the network address and ignore the ip attribute. Optionally provide a separate comparison method that pays attention to the ip attribute (keeping in mind that it isn't particularly hard for people to write out "net1 == net2 and net1.ip == net2.ip" if they care about the extra state).

Then "IPNetwork" can be largely documented as a true IP network definition, with the "Host with Netmask" use case handled by having an IPNetwork object with "net.ip != net.network".

Regards, Nick.

-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia



More information about the Python-Dev mailing list