Comment

Comment by denisrosset

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.

parent denisrosset 4 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton