mutwo.core_constants

Definition of global constants which are used all over mutwo.

Real: TypeAlias = float | fractions.Fraction | int | quicktions.Fraction

The main reason for this constant is a mypy issue with Pythons buildin numbers module which is documented here <https://github.com/python/mypy/issues/3186>_. Mypy doesn’t accept numbers abstract base classes. Until numbers will be supported users have to define their own typing data for general number classes. PEP 3141 recommends users to simply annotate arguments with ‘float’, but this wouldn’t include `fractions.Fraction which is often necessary in musical contexts (as github user arseniiv also remarked).