News for hackers. Stuff that matters.
Re:Please put units in names by teddyh on Monday March 21, 2022 @07:32AM (#30752803)
There are usually libraries for doing this. For Python, there are several, for instance “Pint”.
Re:Please put units in names by BlueTemplar on Monday March 21, 2022 @08:09AM (#30753104)
I was excited when I found Pint, but then was disappointed : too much extra overhead for the project I was then working on.

(I settled on units in variable names instead, was essential when some inputs were literally in different units of the same physical dimension.)

EDIT : more on this, and on astropy (which I was not aware of and/or didn't exist back then) :

https://github.com/astropy/astropy/issues/7438