(original) (raw)
On Mon, Sep 28, 2009 at 7:24 AM, Nick Coghlan <ncoghlan@gmail.com> wrote:
I should note that I've softened my position slightly from what I postedyesterday. I could live with the following compromise:
>>> x == y # Equality is the part I really want to see changed
True
>>> x.ipIPv4Address('192.168.1.0')
IPv4Address('192.168.1.1')
>>> y.ip
With those semantics, IPv4Network objects with distinct IP addresses (but the same network) could no longer be stored in a dictionary or set. IMO, it is a little counter-intuitive for objects to compare equal yet have different properties. I don't think this is a good compromise.
--
Daniel Stutzbach, Ph.D.
President, Stutzbach Enterprises, LLC