Jeroen Demeyer <j.deme...@ugent.be> added the comment:

> 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).

----------
nosy: +jdemeyer

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37406>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to