I am working on a music application in Python and would like to use the fraction module to process the time signature by the way. My problem is that the fractions are simplified, i.e.:
>>> from fractions import Fraction
>>> x = Fraction(4, 4)
>>> x
Fraction(1, 1)
However, from a musical point of view, it is important that 4/4 remains 4/4, even if it is 1. Is there a built-in way to avoid this behavior?
Thank!
source
share