News for hackers. Stuff that matters.
Re:Help us collect modern Python NumPy code solutions by denisrosset on Monday March 28, 2022 @11:22AM (#30831453)
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.

There are no comments on this comment yet.