2 ms·
I'm starting to add type annotations to numerical code, and I wonder how to handle the disconnect between `float` (which is how floating-point literals are type
by denisrosset 5y ago
I'm starting to add type annotations to numerical code, and I wonder how to handle the disconnect between `float` (which is how floating-point literals are typed) and concrete NumPy types such as `numpy.float64` (which is the scalar type I get out of NumPy arrays).
I ended up defining an alias:
Float = Union[float, numpy.float64]
but I wonder if there is a more legitimate way to handle thiss.