From e7786bd2191d2880344d342b5c56ca73931c1286 Mon Sep 17 00:00:00 2001 From: Mark Wiebe Date: Wed, 24 Aug 2011 17:42:19 -0700 Subject: DOC: nditer: Add details about why 'readonly' is the operand default --- doc/source/reference/arrays.nditer.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc/source/reference/arrays.nditer.rst') 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 -- cgit v1.2.1