-
-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Description
I find that np.array silently catches an error raised by __array_interface__. This was confirmed to be a bug on Gitter - https://gitter.im/numpy/numpy?at=6067b4ef3153ce63a3b6dcad
Reproducing code example:
import numpy as np
class Sample:
@property
def __array_interface__(self):
raise OSError
x = Sample()
try:
x.__array_interface__
except OSError:
print("OSError raised by __array_interface__")
np.array(x)
print("But not by np.array")Error message:
No error. That's the problem.
The output of my code example is
OSError raised by __array_interface__
But not by np.array
NumPy/Python version information:
1.20.2 3.8.9 (default, Apr 3 2021, 19:49:13)
[Clang 12.0.0 (clang-1200.0.32.29)]
Metadata
Metadata
Assignees
Labels
No labels