A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-July/120900.html below:

[Python-Dev] cpython: Issue 14814: Correctly return NotImplemented from ipaddress._BaseNetwork.__eq__

[Python-Dev] cpython: Issue 14814: Correctly return NotImplemented from ipaddress._BaseNetwork.__eq__Nick Coghlan ncoghlan at gmail.com
Sat Jul 7 17:18:22 CEST 2012
On Sun, Jul 8, 2012 at 12:59 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Sat, Jul 7, 2012 at 11:55 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> I think the isinstance() test was correct. If you have an object which
>> duck-types IPNetwork, you probably want its __eq__ to be called, not
>> yours.
>
> This change was just to bring IPNetwork in line with the other types
> in the module and to stop it throwing TypeError itself, which meant
> the RHS was never even getting a chance to affect the result.

Hmm, I just noticed the __lt__ implementations still throw TypeError
directly (at least in the IPNetwork case). Looks like some more
cleanups are still needed in this area :P

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
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