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

[Python-Dev] Dict suppressing exceptions

[Python-Dev] Dict suppressing exceptionsMichael Chermside mcherm at mcherm.com
Fri Aug 11 14:37:06 CEST 2006
Guido writes:
> Alas, I have no idea what it does. Can you come up with an example
> that doesn't require enums and localization?

Sorry. Here's the short version:

Fact 1: Sometimes people create objects that raise exceptions when
compared for equality. Maybe it's a bad idea to do this, and objects
should never raise exceptions when compared except to signal internal
inconsistancy -- but the practice is common enough to show up in a
5-star recipe for enums in the Cookbook.

Fact 2: Unrelated objects are often put in dictionarys together. I
used a "localization dictionary" as an example. I feel this is a
legitimate practice.

If dictionarys stop suppressing exceptions raised by equality tests
then those two facts aren't compatible. Programs that used to work
fine will break with 2.4. I'm OK with your proposed solution (fix
the case of str-unicode but let everyone else using objects that
raise exceptions suffer), but I think it would be more friendly to
use warnings for now and exceptions after another full release
cycle. The warnings should solve the underlying issue (hard-to-debug
problems).

-- Michael Chermside

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