Bert Hughes <b.hug...@fmpco.com> added the comment:

Expressions like "Decimal('100.0') < .01" being silently wrong (True!) is 
*very* dangerous behavior, it should raise exception like any other 
Decimal-float operation, and hopefully will be back-ported to 2.7. 

Eg: 3rd party module kinterbasdb, which provides access to Firebird database, 
returns floats from firebird large-int types (eg NUMERIC 18,2) in versions of 
kinrebasdb 3.2 or less, but in versions 3.3+ kinterbasdb retrieves large-int as 
type Decimal. This means if python/kinterbasdb users upgrade kinterbasdb they 
must be aware of this python bug, because all existing code must be inspected 
for "(retrieved Decimal value) compare (float)" statements, which before 
upgrade were Ok (retrieved float value) compare (float)) statements.

I'm new to this tracker, I hope this simply is added as an additional comment & 
squawk of dismay to the "float compared to decimal is silently incorrec" issue.

----------
nosy: +bertchughes
versions: +Python 2.6 -Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue2531>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to