A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2009-September/092356.html below:

[Python-Dev] PEP 3144 review.

[Python-Dev] PEP 3144 review. [Python-Dev] PEP 3144 review.Paul Moore p.f.moore at gmail.com
Wed Sep 30 11:52:29 CEST 2009
2009/9/30 Mark Dickinson <dickinsm at gmail.com>:
> Please could someone who understands the uses of IPNetwork better than
> I do explain why the following wouldn't be a significant problem, if __eq__
> and __hash__ were modified to disregard the .ip attribute as suggested:
>
>>>> linus = IPv4Network('172.16.200.1/24')
>>>> snoopy = IPv4Network('172.16.200.3/24')
>>>> fqdn = {linus: 'linus.peanuts.net', snoopy: 'snoopy.peanuts.net'}
>>>> fqdn[linus]  # expecting 'linus.peanuts.net'
> 'snoopy.peanuts.net'

I certainly don't understand IPv4Network better than you :-) But that
just looks wrong to me - 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).

Paul.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4