diff options
| author | Sebastian Berg <sebastian@sipsolutions.net> | 2019-07-24 16:19:43 -0700 |
|---|---|---|
| committer | Charles Harris <charlesr.harris@gmail.com> | 2019-11-25 18:50:44 -0700 |
| commit | d0d250a3c9d7d90e75701c32d7d435640e6b02eb (patch) | |
| tree | 7c29fad540527fcb8be81e2773397d142e0cd260 | |
| parent | 9ed9806637297aa3915294ce1ae97184529dbd04 (diff) | |
| download | numpy-d0d250a3c9d7d90e75701c32d7d435640e6b02eb.tar.gz | |
REV: "ENH: Improved performance of PyArray_FromAny for sequences of array-like"
This reverts commit 71fc59d587016d6f36007ba06e074d4d4a6b483d
which was part of gh-13399 and the followup commit
ba53a63ee9be7a7bad7685b051a0ef984caa321e from gh-13663.
The issue is that we mix Sequence protocol and `__array__` usage
when coercing arrays. It seems easiest to revert this for the 1.17.x release
and make a larger breaking change in the 1.18.x release cycle.
Since this only occurs for stranger array-likes. This revert is limited
to the 1.17.x branch for now.
| -rw-r--r-- | numpy/core/tests/test_regression.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index d5de0f2b2..3880b1394 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -2484,26 +2484,6 @@ class TestRegression(object): np.array([T()]) - def test_2d__array__shape(self): - class T(object): - def __array__(self): - return np.ndarray(shape=(0,0)) - - # Make sure __array__ is used instead of Sequence methods. - def __iter__(self): - return iter([]) - - def __getitem__(self, idx): - raise AssertionError("__getitem__ was called") - - def __len__(self): - return 0 - - - t = T() - #gh-13659, would raise in broadcasting [x=t for x in result] - np.array([t]) - @pytest.mark.skipif(sys.maxsize < 2 ** 31 + 1, reason='overflows 32-bit python') @pytest.mark.skipif(sys.platform == 'win32' and sys.version_info[:2] < (3, 8), reason='overflows on windows, fixed in bpo-16865') |
