On Sun, Aug 28, 2016 at 4:25 AM, Steven D'Aprano <st...@pearwood.info> wrote:
>
> Sympy (apparently) doesn't warn you if your units are incompatible, it
> just treats them as separate terms in an expression:
>
> py> 2*m + 3*K
> 3*K + 2*m
>
> which probably makes sense from the point of view of a computer algebra
> system (adding two metres and three degrees Kelvin is no weirder than
> adding x and y). But from a unit conversion point of view, I think
> sympy is the wrong solution.

As a generic tool, I would say this is correct. It keeps things simple
and straight-forward. Worst case, you see a strange result at the end,
rather than getting an instant exception; in fact, it's very similar
to NaN, in that some operations might cancel out the "error" status.

ChrisA
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to