-
-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Description
We use NonNull in the interface API like here
numpy/numpy/core/code_generators/numpy_api.py
Line 140 in 855b5ed
| '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?
Metadata
Metadata
Assignees
Labels
No labels