summaryrefslogtreecommitdiff
path: root/numpy/core/shape_base.py
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@gmail.com>2018-10-19 09:16:16 -0700
committerGitHub <noreply@github.com>2018-10-19 09:16:16 -0700
commit024c728ef42d12a2bf10ce3b44791301c4d66f80 (patch)
tree77f1ec9c2fd13355cfcb469c2e0f8acf64fe4e4b /numpy/core/shape_base.py
parentdfab760b4a328d9fa29cef123e0fe8e2926b0c8c (diff)
downloadnumpy-024c728ef42d12a2bf10ce3b44791301c4d66f80.tar.gz
MAINT: add comment explaining _block_dispatcher
Diffstat (limited to 'numpy/core/shape_base.py')
-rw-r--r--numpy/core/shape_base.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py
index 69e8c0afc..ff6e66515 100644
--- a/numpy/core/shape_base.py
+++ b/numpy/core/shape_base.py
@@ -500,6 +500,9 @@ def _block(arrays, max_depth, result_ndim, depth=0):
def _block_dispatcher(arrays):
+ # Use type(...) is list to match the behavior of np.block(), which special
+ # cases list specifically rather than allowing for generic iterables or
+ # tuple. Also, we know that list.__array_function__ will never exist.
if type(arrays) is list:
for subarrays in arrays:
for subarray in _block_dispatcher(subarrays):