STINNER Victor added the comment:

Ah yes. Some months (years?) ago, i started to add assertions to fail if
some functions are called with an exception set.

Checking if an exception is set at runtime adds a low overhead. Maybe it's
better to fail with a fatal error (like an assertion error) in debug mode
(and do nothing in release mode).

But I'm not sure that developers of C extensions are all able to get a
Python compiled in debug mode :-/ That's also why I added a check a
runtime: raise a SystemError if a function with an exception set. I also
added PYTHONMALLOC=debug to make some debug checks easily available on
release builds.

The bug also reminds me my PEP 490 to chain exceptions. It would be
yet another option...

So well, I don't know what is the best option.

----------

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

Reply via email to