[Python-Dev] Dict suppressing exceptions

M.-A. Lemburg mal at egenix.com
Fri Aug 11 11:48:25 CEST 2006


Armin Rigo wrote:
> Hi,
> 
> On Thu, Aug 10, 2006 at 02:36:16PM -0700, Guido van Rossum wrote:
>>> On Thu, Aug 10, 2006 at 09:11:42PM +0200, "Martin v. L?wis" wrote:
>>>> I'm in favour of having this __eq__ just return False. I don't think
>>>> the warning is necessary, (...)
>>> +1
>> Can you explain why you believe that no warning is necessary?
> 
> Ah... mostly out of ignorance, I fear.  I did not realize there were
> strange cases like u"\xff" == "\xff". 

This is not all that strange. Perhaps this example looks closer
to life ;-)

if u'D\xfcsseldorf' != 'D\xfcsseldorf':
    move_to_Cologne()

Now, we wouldn't want that to go through without a warning,
do we... ;-)

[Background: there's a bit of rivalry between those two cities;
 see e.g. see http://en.wikipedia.org/wiki/D%C3%BCsseldorf]

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 11 2006)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-Dev mailing list