summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarren Weckesser <warren.weckesser@gmail.com>2021-10-19 23:27:42 -0400
committerWarren Weckesser <warren.weckesser@gmail.com>2021-10-19 23:30:04 -0400
commitd9f8333fc8fb0b1de88df7864c9f29a47eece3e6 (patch)
treed1858d2de18f82250bc2048f47632bd8a2ccac5a
parentf17d410410e4aa86193e60f946af1e2e76f2410e (diff)
downloadnumpy-d9f8333fc8fb0b1de88df7864c9f29a47eece3e6.tar.gz
MAINT: core: Update the comment about _parse_signature with more complete info.
-rw-r--r--numpy/core/src/umath/ufunc_object.c21
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)