[Python-Dev] PEP 3144 review. (original) (raw)
Daniel Stutzbach daniel at stutzbachenterprises.com
Mon Sep 28 16:04:58 CEST 2009
- Previous message: [Python-Dev] PEP 3144 review.
- Next message: [Python-Dev] PEP 3144 review.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Sep 28, 2009 at 7:24 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
I should note that I've softened my position slightly from what I posted yesterday. I could live with the following compromise:
>>> x = IPv4Network('192.168.1.1/24') >>> y = IPv4Network('192.168.1.0/24') >>> x == y # Equality is the part I really want to see changed True >>> x.ip IPv4Address('192.168.1.1') >>> y.ip IPv4Address('192.168.1.0')
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 <http://stutzbachenterprises.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20090928/a40aec1b/attachment.htm>
- Previous message: [Python-Dev] PEP 3144 review.
- Next message: [Python-Dev] PEP 3144 review.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]