from numbers import Rational from typing import Union Scalar = Union[Rational, float]