bpo-29881: Add new C API for variables init once by vstinner · Pull Request #780 · python/cpython (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I agree that the case can occur in practice, I'm not confortable with supporting "reentrant calls" (reentrant calls to _PYONCEVAR_INIT() to be exact). I prefer to start with an assertion, and decide how to handle this corner case if it occurs in practice.
If reentrant calls occurs, to be clear: it would already be a bug in CPython, right? So my code doesn't make CPython worse. It's better, since the assertion now detects the bug.