> For example, in NumPy: > > np.median(np.float32([1, 2, 3, 4])) > > did return a float64 before and will now return a float32. I assume > because somewhere we write: `(np.float64(3) + np.float32(2)) / 2`.
Sorry, I missed this part of the discussion — I know the discussion centered around Python literals being weak, but for NumPy dtypes, I thought the larger dtype would always win? Indeed, reading the NEP I see: Expression: array([1.], float32) + array(1., float64) Old result: array([2.], float32) New result: array([2.], float64) which seems to contradict your statement above? _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: arch...@mail-archive.com