From 4f8e93a3b26f15bb96d86ee05d672b51cda1e935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Bissey?= Date: Tue, 10 Nov 2015 14:25:34 +1300 Subject: Let linspace accept input that has an array_interface but is not otherwise a numpy or python type. --- numpy/core/function_base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'numpy/core/function_base.py') diff --git a/numpy/core/function_base.py b/numpy/core/function_base.py index 05fea557a..5070608b7 100644 --- a/numpy/core/function_base.py +++ b/numpy/core/function_base.py @@ -87,8 +87,10 @@ def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None): div = (num - 1) if endpoint else num # Convert float/complex array scalars to float, gh-3504 - start = start * 1. - stop = stop * 1. + # Make sure one can use variables that have an __array_interface__, gh-6634 + from numpy import asarray + start = asarray(start) * 1. + stop = asarray(stop) * 1. dt = result_type(start, stop, float(num)) if dtype is None: -- cgit v1.2.1