Message346983
> Python's exception mechanism is a much better way to signal and handle such errors at the application level.
I disagree. There is a difference between exceptions which are possible in normal usage of the code and real bugs, which shouldn't ever happen. A NULL argument to a C API function is not an ordinary exception, it's a real bug. Even if we raise a Python exception for that, it should never be handled in a try/exception block like an ordinary exception.
> Using assert() in C is a pretty bad alternative, since this crashes the whole process.
I *prefer* debugging an assert() failure (which is pretty easy with a decent debugger) rather than debugging a Python exception raised from C (which typically does NOT give a useful traceback). |
|
Date |
User |
Action |
Args |
2019-07-01 09:17:44 | jdemeyer | set | recipients:
+ jdemeyer, lemburg, vstinner, serhiy.storchaka |
2019-07-01 09:17:44 | jdemeyer | set | messageid: <1561972664.34.0.878651854006.issue37406@roundup.psfhosted.org> |
2019-07-01 09:17:44 | jdemeyer | link | issue37406 messages |
2019-07-01 09:17:44 | jdemeyer | create | |
|