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/2006-August/068191.html below:

[Python-Dev] Dict suppressing exceptions

[Python-Dev] Dict suppressing exceptions [Python-Dev] Dict suppressing exceptionsGuido van Rossum guido at python.org
Sat Aug 12 06:06:13 CEST 2006
On 8/11/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Michael Chermside schrieb:
> > I propose that we institute a new policy. The policy should state:
> >
> >    __eq__ methods should always return True or False. They should
> >    only raise an exception if there is some internal error within
> >    one of the objects being compared -- they should never raise
> >    an exception because the other object is of an unexpected type.
>
> That policy is currently difficult to implement, but reasonable
> (difficult because it is quite some code to write).

Why? Are you thinking of the standard library, or of an end user's
__eq__ method? Returning False from your __eq__ if other's type is
unexpected doesn't seem a lot of code. Or am I misunderstanding
something?

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
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