Paul Moore wrote:
linus and snoopy are hosts not networks, so
making them IPv4Network classes seems wrong. I'd instinctively make
them IPv4Address objects (which, I believe, would work).

However, by allowing IPNetwork objects to also contain
a host address, we seem to be officially sanctioning
such abuse, or at least turning a blind eye to it.

It's possible that the user is thinking of linus and
snoopy as being *both* networks and host addresses,
in which case this kind of mistake will be easy to
make. Not to mention the potential confusion in the
mind of someone trying to read or maintain the code.

My feeling is that we shouldn't accept this kind of
compromise as being "good enough". Once a module is
in the stdlib, we're going to be stuck with it for
quite a while, so I think it's worth taking some
time to make sure that what we adopt is based on a
conceptually sound design.

Peter is of course within his rights not to change
his module in this way. But this just means that
ipaddr is not the right module to adopt, and we
should design another one and give it a different
name.

--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to