[Python-Dev] Dict suppressing exceptions
"Martin v. Löwis"
martin at v.loewis.de
Thu Aug 10 21:11:42 CEST 2006
Guido van Rossum schrieb:
> Hmm... Here's an idea... How about we change unicode-vs-str __eq__ to
> issue a warning (and return False) instead of raising
> UnicodeException?
I'm in favour of having this __eq__ just return False. I don't think
the warning is necessary, and believe that people will complain about
getting it, but if that is the only way to achieve consensus,
so be it.
> A warning would arguably have the same helping effect. (I suspect
> actually that we would have used warnings all along except we didn't
> have the warning framework when unicode was first introduced.)
I believe we would have neither had we rich comparisons available
at the time. That unicode-vs-str-__eq__ raises an exception is just
a fall-out of not supporting __cmp__ (and it is good that __cmp__
is not supported - there is no meaningful way to order str/unicode
if the string is not in the system encoding).
Regards,
Martin
More information about the Python-Dev
mailing list