diff options
| author | Sebastian Berg <sebastianb@nvidia.com> | 2023-01-26 12:16:23 +0100 |
|---|---|---|
| committer | Sebastian Berg <sebastianb@nvidia.com> | 2023-02-10 14:49:16 +0100 |
| commit | c03e84044a05f0b2358a1cbfc4158e83cba4b835 (patch) | |
| tree | d2d6acb05816db3a815f50967c0cb22f3d896c35 /numpy/lib/function_base.py | |
| parent | 624b18090ae567f3cfd528a8ae156b2ae7db6d82 (diff) | |
| download | numpy-c03e84044a05f0b2358a1cbfc4158e83cba4b835.tar.gz | |
API: Modify `gradient` to return a tuple rather than a list
This change is staged for NumPy 2.0, I assume we could get away with
it otherwise, but it is a nice example and probably not pressing.
Diffstat (limited to 'numpy/lib/function_base.py')
| -rw-r--r-- | numpy/lib/function_base.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 0ca3c21c1..1f39ebc71 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -1311,6 +1311,8 @@ def gradient(f, *varargs, axis=None, edge_order=1): if len_axes == 1: return outvals[0] + elif np._numpy2_behavior: + return tuple(outvals) else: return outvals |
