I landed bpo-31338 / PR #3374 which adds a Py_UNREACHABLE() macro to master, 
along with some additional documentation in the C API describing this and a few 
other common macros.  If you’re writing or reviewing C changes that include 
unreachable code paths, please use this macro for consistency, instead of other 
approaches like assert() (which can be compiled out) and `return NULL`, etc.

As part of the PR, I changed a bunch of existing instances in the code:

https://github.com/python/cpython/pull/3374/files

If you find any cases I’ve missed, feel free to submit a PR and I will happily 
review it.  I think this makes our code more consistent and ultimately safer.

(Thanks Victor for the PR review!)

Cheers,
-Barry

Attachment: signature.asc
Description: Message signed with OpenPGP

_______________________________________________
python-committers mailing list
python-committers@python.org
https://mail.python.org/mailman/listinfo/python-committers
Code of Conduct: https://www.python.org/psf/codeofconduct/

Reply via email to