From a3a19daff9330f0196aba90582450d022fc8798c Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Sun, 12 May 2019 18:35:52 -0700 Subject: ENH: Allow broadcast to be called with zero arguments Follows on from gh-6905 which reduced the limit from 2 to 1. Let's go all the way to zero. Just as for `broadcast(broadcast(a), b)` is interpreted as `broadcast(a, b)` , this change interprets `broadcast(broadcast(), a)` as `broadcast(a)`. --- numpy/lib/stride_tricks.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'numpy/lib/stride_tricks.py') diff --git a/numpy/lib/stride_tricks.py b/numpy/lib/stride_tricks.py index 0dc36e41c..fd401c57c 100644 --- a/numpy/lib/stride_tricks.py +++ b/numpy/lib/stride_tricks.py @@ -186,8 +186,6 @@ def _broadcast_shape(*args): """Returns the shape of the arrays that would result from broadcasting the supplied arrays against each other. """ - if not args: - return () # use the old-iterator because np.nditer does not handle size 0 arrays # consistently b = np.broadcast(*args[:32]) -- cgit v1.2.1