summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-08-24 17:42:19 -0700
committerCharles Harris <charlesr.harris@gmail.com>2011-08-25 20:09:43 -0600
commite7786bd2191d2880344d342b5c56ca73931c1286 (patch)
treeac8c3f6bbf73a8ccd3b4c106d5793bb9c958d022
parent62c568837204cddfd9dca445190b227be578f5c1 (diff)
downloadnumpy-e7786bd2191d2880344d342b5c56ca73931c1286.tar.gz
DOC: nditer: Add details about why 'readonly' is the operand default
-rw-r--r--doc/source/reference/arrays.nditer.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/source/reference/arrays.nditer.rst b/doc/source/reference/arrays.nditer.rst
index 3fb52f126..7dc3aa52a 100644
--- a/doc/source/reference/arrays.nditer.rst
+++ b/doc/source/reference/arrays.nditer.rst
@@ -399,7 +399,11 @@ just the two operands to the iterator, and it handled the rest.
When adding the 'out' parameter, we have to explicitly provide those flags,
because if someone passes in an array as 'out', the iterator will default
-to 'readonly', and our inner loop would fail.
+to 'readonly', and our inner loop would fail. The reason 'readonly' is
+the default for input arrays is to prevent confusion about unintentionally
+triggering a reduction operation. If the default were 'readwrite', any
+broadcasting operation would also trigger a reduction, a topic
+which is covered later in this document.
While we're at it, let's also introduce the 'no_broadcast' flag, which
will prevent the output from being broadcast. This is important, because