-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Closed
Labels
Description
According to the docs, numpy scalars are supposed to have the same methods as arrays, but the astype method behaves differently by not accepting keyword arguments. This can cause issues for code that wants to accept scalars and arrays interchangeably e.g. see thunder-project/thunder#121 (not my use case, just the first hit I found).
Sample code (numpy 1.13.1):
>>> import numpy as np
>>> np.float64(1).astype(np.float32, casting='same_kind')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: astype() takes no keyword argumentsReactions are currently unavailable