We use NonNull in the interface API like here
|
'PyArray_NewFromDescr': (94, StealRef(2), NonNull([1, 2])), |
I think this is an anti-pattern since
- These are interface functions. It is on us to actively check NULL input, not to politely suggest that input cannot be NULL.
- The compiler directives generated are only suggestions, and we know how often users relate to warnings
- Some compilers and interface mechanisms have no idea that these hints are there. For instance, these functions are exported from the shared object and can be called by CTypes. How will the compiler hint help?
We use NonNull in the interface API like here
numpy/numpy/core/code_generators/numpy_api.py
Line 140 in 855b5ed
I think this is an anti-pattern since