-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Currently, any exception raised will be ignored and it will print "exception is ignored" to stderr. Then, the user has to manage all those error codes manually (which requires reading Cython source code which may be a bit too much for an average user).
Maybe throw proper Python exceptions instead? That would arguably be a much more Pythonic way of doing that:
https://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#error-return-values
So instead of stuff like
return_code = mkl.set_foo(...)
if return_code != 'success':
if return_code == 'err_invalid_input':
raise RuntimeError('invalid input in mkl')
you could do just
mkl.set_foo(...)
which would throw an MKLError('invalid input')
if it fails, so you could catch it later.
Metadata
Metadata
Assignees
Labels
No labels