3 ms·
This is really an issue with Python in general (specifically, mutable types). You'd get the exact same behavior with numpy ndarrays (of which astropy Quantitie
by DiogenesKynikos 5y ago
This is really an issue with Python in general (specifically, mutable types).
You'd get the exact same behavior with numpy ndarrays (of which astropy Quantities are a subclass).
- dragonwriter 5y ago> 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.