Re: [Numpy-discussion] New DTypes: Are scalars a central concept in NumPy or not?

Feb. 25, 2020
4 a.m.
The fact that `isinstance(np.float64(1), float)` raises the problem that the current implementation of np.float64 scalars breaks the Liskov substitution principle: `sequence_or_array[round(x)]` works if `x` is a float, but breaks down if x is a np.float64. See https://github.com/numpy/numpy/issues/11810, where the issue is discussed in the broader setting of the semantics of `np.round` vs. python3 `round`. I do not have a strong opinion here, except that if np.float64’s are within the python number hierarchy they should be PEP 3141 compliant (which currently they are not.) Stefano
1844
Age (days ago)
1844
Last active (days ago)
0 comments
1 participants
participants (1)
-
Stefano Miccoli