diff options
author | Matti Picus <matti.picus@gmail.com> | 2021-10-20 08:00:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-20 08:00:55 +0300 |
commit | 5cb560616abe44774d897a80970775d2a26bb03b (patch) | |
tree | d1858d2de18f82250bc2048f47632bd8a2ccac5a | |
parent | f17d410410e4aa86193e60f946af1e2e76f2410e (diff) | |
parent | d9f8333fc8fb0b1de88df7864c9f29a47eece3e6 (diff) | |
download | numpy-5cb560616abe44774d897a80970775d2a26bb03b.tar.gz |
Merge pull request #20142 from WarrenWeckesser/update-parse-sig-comment
MAINT: core: Update the comment about _parse_signature with more complete info.
-rw-r--r-- | numpy/core/src/umath/ufunc_object.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index 7824173e2..15385b624 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -616,9 +616,24 @@ _is_same_name(const char* s1, const char* s2) } /* - * Sets core_num_dim_ix, core_num_dims, core_dim_ixs, core_offsets, - * and core_signature in PyUFuncObject "ufunc". Returns 0 unless an - * error occurred. + * Sets the following fields in the PyUFuncObject 'ufunc': + * + * Field Type Array Length + * core_enabled int (effectively bool) N/A + * core_num_dim_ix int N/A + * core_dim_flags npy_uint32 * core_num_dim_ix + * core_dim_sizes npy_intp * core_num_dim_ix + * core_num_dims int * nargs (i.e. nin+nout) + * core_offsets int * nargs + * core_dim_ixs int * sum(core_num_dims) + * core_signature char * strlen(signature) + 1 + * + * The function assumes that the values that are arrays have not + * been set already, and sets these pointers to memory allocated + * with PyArray_malloc. These are freed when the ufunc dealloc + * method is called. + * + * Returns 0 unless an error occurred. */ static int _parse_signature(PyUFuncObject *ufunc, const char *signature) |