New-C-API-for-Python
New-C-API-for-Python copied to clipboard
Avoid `NULL`s as much as possible.
It should be clear in both the design principles, and where applicable, in the design rules, that NULL is to be avoided as much as possible.
NULLs are a potential source of bugs, and should be avoided where possible.
There are cases where the API needs to accept pointers, and should accept NULLs in those cases.
But the API should never return NULL.
Using opaque PyRefs avoid the need for NULLs in most cases, but when we accept an array of PyRefs, there is the possibility of NULLs.