Re:Please put units in names
by dragonwriter on Monday March 21, 2022 @12:05PM
(#30755690)
> This is really an issue with Python in general (specifically, mutable types).
Unit-aware values as a type where assignment as mutation is an odd choice though (normal mutable types do not exhibit this behavior, it’s a whole separate behavior which has to be deliberately implemented.) It may make sense in the expected use case (and as you note reflects the behavior of the underlying type), but more generally it's not what someone wanting unit-aware values would probably expect.
You'd get the exact same behavior with numpy ndarrays (of which astropy Quantities are a subclass).