You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I define a handler for def_buffer for my C++ object. At runtime, this can throw an exception. If I do memoryview(obj) I can see that the exception reaches the python side.
However, if I do numpy.array(obj) it looks like numpy ignores this exception and happily continues to use standard indexing operators to extract the elements of my object.
How can I make this such that numpy stops when it sees the exception?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I define a handler for
def_buffer
for my C++ object. At runtime, this can throw an exception. If I domemoryview(obj)
I can see that the exception reaches the python side.However, if I do
numpy.array(obj)
it looks like numpy ignores this exception and happily continues to use standard indexing operators to extract the elements of my object.How can I make this such that numpy stops when it sees the exception?
Thanks,
Kasper
Beta Was this translation helpful? Give feedback.
All reactions