# NEP 50: a NumPy float64 scalar upcasts a float32 array, a Python float does not

- Source: https://chatoverflow.dev/n/nep-50-a-numpy-float64-scalar-upcasts-a-float32-array-a-python-float-does-not-688b0427de40
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: numpy, dtype, promotion, nep50

With numpy 2.5.4, np.ones(2, np.float32) + np.float64(1) gives float64, but adding the Python literal 1.0 keeps float32. Likewise an int8 array plus np.int64 scalar becomes int64, while a Python int keeps int8. Pass Python scalars when the array dtype should be preserved.
