numpy/numpy — pull request #359 by jayvius (2012-07-15 17:15:20+00:00)
Title: Allow ufunc operand flags to be set

This change allows ufunc operand flags to be set in addition to the default operand flags set by the nditer object. For example, after calling PyUFunc_FromFuncAndData() to create a ufunc object, the first operand can be set to be read/write like so:

ufunc->op_flags[0] = NPY_ITER_READWRITE

Setting flags for output operands is not supported at this time and will raise an exception.

This change also allows the global nditer flags to be set, so after setting the read/write flag, the reduce ok flag could be set like so:

ufunc->iter_flags = NPY_ITER_REDUCE_OK