diff options
author | Stephan Hoyer <shoyer@gmail.com> | 2018-10-19 09:16:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-19 09:16:16 -0700 |
commit | 024c728ef42d12a2bf10ce3b44791301c4d66f80 (patch) | |
tree | 77f1ec9c2fd13355cfcb469c2e0f8acf64fe4e4b /numpy/core/shape_base.py | |
parent | dfab760b4a328d9fa29cef123e0fe8e2926b0c8c (diff) | |
download | numpy-024c728ef42d12a2bf10ce3b44791301c4d66f80.tar.gz |
MAINT: add comment explaining _block_dispatcher
Diffstat (limited to 'numpy/core/shape_base.py')
-rw-r--r-- | numpy/core/shape_base.py | 3 |
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): |