Closed frejanordsiek closed 4 years ago
Added in commit 957df63ae4aadc7c4a3d2e01433971f9cd8f12a9 with the new marshaller Marshallers.PythonFractionMarshaller
. It is stored as a dict
of its numerator and denominator. Since the fractions
module is not used elsewhere in the hdf5storage package, it is not imported by default. Instead it is imported only as needed. This means that Marshallers.PythonFractionMarshaller
is a good simple example of how to write a marshaller for a type in a module that should only be loaded as needed.
Adding read/write support for
fractions.Fraction
(https://docs.python.org/3/library/fractions.html).