diff options
author | Sebastian Berg <sebastianb@nvidia.com> | 2023-05-10 15:11:38 +0200 |
---|---|---|
committer | Sebastian Berg <sebastianb@nvidia.com> | 2023-05-15 12:43:30 +0200 |
commit | 21602a8b1673a7b468d032ef19c20c53ac15c0b9 (patch) | |
tree | 542eddc432d5a6004c9bbc34a119e4bf58163b34 /numpy/core/src/multiarray | |
parent | b8a43cb809edd754044af4aadfb9295915333b98 (diff) | |
download | numpy-21602a8b1673a7b468d032ef19c20c53ac15c0b9.tar.gz |
BUG: Fix weak scalar logic for large ints in ufuncs
This fixes it, breaks warnings (partially), but most or all of
those paths should be errors anyway.
Diffstat (limited to 'numpy/core/src/multiarray')
-rw-r--r-- | numpy/core/src/multiarray/arrayobject.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/arrayobject.h b/numpy/core/src/multiarray/arrayobject.h index f7d0734db..d9900439c 100644 --- a/numpy/core/src/multiarray/arrayobject.h +++ b/numpy/core/src/multiarray/arrayobject.h @@ -40,6 +40,13 @@ static const int NPY_ARRAY_WARN_ON_WRITE = (1 << 31); static const int NPY_ARRAY_WAS_PYTHON_INT = (1 << 30); static const int NPY_ARRAY_WAS_PYTHON_FLOAT = (1 << 29); static const int NPY_ARRAY_WAS_PYTHON_COMPLEX = (1 << 28); +/* + * Mark that this was a huge int and the array needed replace (no re-use). + * This flag is only used in the ufunc machinery where it is tricky to cover + * correct all type resolution paths where `np.array(large_integer)` returns + * an object array. + */ +static const int NPY_ARRAY_WAS_INT_AND_REPLACED = (1 << 27); static const int NPY_ARRAY_WAS_PYTHON_LITERAL = (1 << 30 | 1 << 29 | 1 << 28); #endif /* NUMPY_CORE_SRC_MULTIARRAY_ARRAYOBJECT_H_ */ |