This facilitate serializing and deserializing. If you have two function: serialize and deserialize, then your code will be as simple as this >>> serialized = serialize(q1.to_tuple()) >>> q2 = ureg.Quantity.from_tuple(deserialize(serialized))