diff options
author | Stephan Hoyer <shoyer@google.com> | 2018-12-19 10:08:01 -0800 |
---|---|---|
committer | Stephan Hoyer <shoyer@google.com> | 2018-12-19 10:46:40 -0800 |
commit | 45413455791c77465c5f33a5082053274eb18900 (patch) | |
tree | 7362d739f4558b4aece09bbde333df5c219d8f1a /numpy/core/multiarray.py | |
parent | f4ddc2b3251d4606cc227761933e991131425416 (diff) | |
download | numpy-45413455791c77465c5f33a5082053274eb18900.tar.gz |
ENH: refactor __array_function__ pure Python implementation
Diffstat (limited to 'numpy/core/multiarray.py')
-rw-r--r-- | numpy/core/multiarray.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/core/multiarray.py b/numpy/core/multiarray.py index 1b9c65782..4c2715892 100644 --- a/numpy/core/multiarray.py +++ b/numpy/core/multiarray.py @@ -211,9 +211,11 @@ def concatenate(arrays, axis=None, out=None): fill_value=999999) """ - for array in arrays: - yield array - yield out + if out is not None: + # optimize for the typical case where only arrays is provided + arrays = list(arrays) + arrays.append(out) + return arrays @array_function_from_c_func_and_dispatcher(_multiarray_umath.inner) |