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

Raymond Hettinger raymond.hettinger at gmail.com
Fri Mar 19 19:47:45 CET 2010

On Mar 19, 2010, at 11:42 AM, Glenn Linderman wrote:
> The whole point of providing Decimal is for applications for which float is inappropriate.  I didn't think I needed to reproduce PEP 327 in my email.
> So when a coder choose to use Decimal, it is because float is inappropriate.  Because float is inappropriate, mixing Decimal and float is inappropriate.  Having the language coerce implicitly, is inappropriate.  All this is in the PEP.  Note that the PEP actually says that the problem is not doing implicit arithmetic (as some have reported in this thread) but in doing implicit coercions.  In order to do implicit comparisons, one must do an implicit coercion.  Hence the PEP actually already prohibits implicit comparisons, as well as implicit arithmetic.

Well said.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20100319/dfaa421b/attachment.html>

More information about the Python-Dev mailing list