|
|
|
|
|
by chrismorgan
907 days ago
|
|
I don’t understand why you’d go to the enormous trouble of extending the syntax when you can write it with perfectly normal syntax. A value-with-unit is, after all, just a scalar multiplied by the unit, and I suppose this would work with the underlying library pint: >>> speed = 5*meters/second
>>> (2 * seconds) * speed
10 meter
Given the ecosystem problems and other problems extending the syntax gets you, I don’t get why you’d do this at all, when all it gets you is the ability to write ' ' instead of '*'. |
|
> I don’t understand why you’d go to the enormous trouble
But more importantly, it was just really fun to get it working.