New-C-API-for-Python icon indicating copy to clipboard operation
New-C-API-for-Python copied to clipboard

Avoid `NULL`s as much as possible.

Open markshannon opened this issue 3 years ago • 0 comments

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.

markshannon avatar Sep 22 '22 12:09 markshannon