10 Apr
2022
10 Apr
'22
8:57 p.m.
On 4/9/22 21:17, Stephen J. Turnbull wrote:
if 12*u.mm * 42*u.MFr == 502*u.foo: print('Well done!')
That would work fine for me. But I can see why somebody who frequently uses interactive Python as a scientific calculator would prefer to write
if 12 m/s * 42 s == 502 m: print('Well done!')
with the base SI repertoire (a dozen or so prefixes and 7 units) in builtins.
Part of the argument as well, I think, is that the top expression would be parsed as: ((12 * u.m) * 42) * u.MFr which, if actually equal to 502*u.foo, is dumb luck. -- ~Ethan~