[Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Mar 20 01:50:50 CET 2010


Glenn Linderman wrote:

> Sounds to me like containment checking is wrong; that if it gets an 
> exception during the comparison that it should assume unequal, rather 
> than aborting, and continue to the next entry.

What exception would it catch, though? Catching something as
generic as TypeError would be a very bad idea, I think -- there
would be too much potential for it to mask bugs.

It might be acceptable if there were a special subclass of
TypeError for this, such as NotComparableError.

What happens in Py3 here, BTW? It must have the same problem
if it refuses to compare some things for equality.

-- 
Greg


More information about the Python-Dev mailing list