On Tue, 18 May 2021 at 16:55, Martin Teichmann
<martin.teichm...@gmail.com> wrote:
>
> Hi Paul,
>
> > > I'd actually prefer to write (m*v**2)/2. Or (m/2)*v**2. But those
> > wouldn't work, the way you describe your proposal. And I'd be very
> > concerned if they behaved differently than 1/2 * m * v**2...
>
> Sure they do work, and they work exactly the same way. That is acually the 
> point: currently 1/2 * m * v**2 is not the same as (m/2) * v**2 (in sympy, 
> that is), with my proposal it would be exactly the same (again, from my 
> prototype, not fake):
>
>     >>> m, v, r = symbols("m v r")
>     >>> 1/2 * m * v**2
>     m*v**2/2
>     >>> (m/2) * v**2
>     m*v**2/2
>     >>> (m * v**2) / 2
>     m*v**2/2
>     >>> 4/3 * pi * r**3
>     4*pi*r**3/3

But *not* in sympy, in normal Python, if m == 1 and v == 1, then 1/2 *
m * v**2 is 0.5 (a float) currently, as is (m/2) * v**2. But in your
proposal, the former will be a float/fraction hybrid, whereas the
latter will be a float.

And what about

x = 1

a = 1/3
b = x/3
a == Fraction(1,3)
b == Fraction(1,3)
a == b

Currently these are False, False, True. You'll change that to True,
False, True and you've now broken the idea that things that are equal
should compare the same to a 3rd value.

Never mind. At the end of the day, I simply think your proposal is not
viable. We can argue details all day, but I'm not going to be
persuaded otherwise.
Paul
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/PGIFQT6CYIRPJJ3KVDFDN7PRYJSVJKVA/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to