Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 16d6996 + b81da1d commit dc5f21eCopy full SHA for dc5f21e
numpy/_core/tests/test_array_coercion.py
@@ -762,6 +762,17 @@ def __getitem__(self):
762
with pytest.raises(error):
763
np.array(BadSequence())
764
765
+ def test_array_interface_descr_optional(self):
766
+ # The descr should be optional regresion test for gh-27249
767
+ arr = np.ones(10, dtype="V10")
768
+ iface = arr.__array_interface__
769
+ iface.pop("descr")
770
+
771
+ class MyClass:
772
+ __array_interface__ = iface
773
774
+ assert_array_equal(np.asarray(MyClass), arr)
775
776
777
class TestAsArray:
778
"""Test expected behaviors of ``asarray``."""
0 commit comments