On Wed, 17 Mar 2010 09:16:11 am Greg Ewing wrote:
> Mark Dickinson wrote:
> > On Tue, Mar 16, 2010 at 3:58 PM, P.J. Eby <p...@telecommunity.com> 
wrote:
> >>If not, it might be confusing if a number that prints as '.1'
> >> compares unequal to Decimal('.1').
> >
> > Agreed, but this is just your everyday floating-point confusion, to
> > be dealt with by social means (e.g., educating the programmer).
>
> Seems to me that this education would mostly consist of saying
> "don't compare floats and decimals", which is why I think that
> disallowing them in the first place would be better.

I'm sure you don't mean to suggest that the only (or even the main) 
source of floating point confusion comes from mixed Decimal/float 
operations.


> Then if a programmer truly needs to compare them for some
> reason, he has to be explicit about how to do it.

More explicit than someDecimal == someFloat? Seems pretty explicit to 
me.



-- 
Steven D'Aprano
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to