summaryrefslogtreecommitdiff
path: root/numpy/array_api/_array_object.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-06-21 16:09:31 -0700
committerSebastian Berg <sebastian@sipsolutions.net>2022-06-21 16:09:31 -0700
commit0884dab487870646d669157a3e2524622ab1cdf4 (patch)
tree7919306386be830aa2ce9fd9c606a405f3e5c39f /numpy/array_api/_array_object.py
parent70026c4dde47d89d6a7a4916bfac045e714a5b4f (diff)
downloadnumpy-0884dab487870646d669157a3e2524622ab1cdf4.tar.gz
ENH: Always fill object fields with None rather than NULL
The intention here is to transition (or achieve?) a future where NumPy always fills object fields with None rather than NULL. Filling with NULL is nice (infinitely fast in some cases and easy), but it also adds the trap of expecting NULLs everywhere. Most importantly, cython fails to do so (currently) so this is a bug magnet. At this point, ideally any fully created array is guaranteed to be initialized with proper Python objects. Downstream may break that, so we should not allow it, but this does also add an assert to many ufuncs to flush out further potential issues. NULL initialization is (as of now) still relevant for new buffers. That means that core functionality like `setitem`, or coping into a buffer should still expect a NULL initialized value.
Diffstat (limited to 'numpy/array_api/_array_object.py')
0 files changed, 0 insertions, 0 deletions