summaryrefslogtreecommitdiff
path: root/numpy/core/include
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-01-09 16:28:09 +0200
committerSebastian Berg <sebastian@sipsolutions.net>2019-01-09 15:28:09 +0100
commitf5b6850f231de80b067e06e01d11bec4bd535c58 (patch)
tree381b919bb15da5f5bef8b4d6075fe91ab96cd709 /numpy/core/include
parentad0e902717d1245d17856d47d7f16bc7817da866 (diff)
downloadnumpy-f5b6850f231de80b067e06e01d11bec4bd535c58.tar.gz
BUG: reference cycle in np.vectorize (#11977)
This implements cyclic support by adding `tp_traverse` to ufuns which may contain a user provided object function (`np.frompyfunc`). Ufuncs that do not add this are not added to the circular reference count tracking. The ufunc does not need to implement `tp_clear` because it is an immutable object.
Diffstat (limited to 'numpy/core/include')
-rw-r--r--numpy/core/include/numpy/ufuncobject.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h
index 90d837a9b..15dcdf010 100644
--- a/numpy/core/include/numpy/ufuncobject.h
+++ b/numpy/core/include/numpy/ufuncobject.h
@@ -120,7 +120,11 @@ typedef struct _tagPyUFuncObject {
*/
int nin, nout, nargs;
- /* Identity for reduction, either PyUFunc_One or PyUFunc_Zero */
+ /*
+ * Identity for reduction, any of PyUFunc_One, PyUFunc_Zero
+ * PyUFunc_MinusOne, PyUFunc_None, PyUFunc_ReorderableNone,
+ * PyUFunc_IdentityValue.
+ */
int identity;
/* Array of one-dimensional core loops */
@@ -301,7 +305,7 @@ typedef struct _tagPyUFuncObject {
*/
#define PyUFunc_ReorderableNone -2
/*
- * UFunc unit is in identity_value, and the order of operations can be reordered
+ * UFunc unit is an identity_value, and the order of operations can be reordered
* This case allows reduction with multiple axes at once.
*/
#define PyUFunc_IdentityValue -3