code: def test_arraylike_classes(self):
      # The classes of array-likes should generally be acceptable to be
      # stored inside a numpy (object) array.  This tests all of the
      # special attributes (since all are checked during coercion).
      arr = np.array(np.int64)
      assert arr[()] is np.int64
      arr = np.array([np.int64])
      assert arr[0] is np.int64
  
      # This also works for properties/unbound methods:
      class ArrayLike:
          @property
          def __array_interface__(self):
              pass
  
          @property
          def __array_struct__(self):
              pass
  
          def __array__(self):
              pass
  
      arr = np.array(ArrayLike)
      assert arr[()] is ArrayLike
      arr = np.array([ArrayLike])
      assert arr[0] is ArrayLike
  
imports: from itertools import permutations, product
  import pytest
  from pytest import param
  import numpy
  import numpy._core._multiarray_umath
  from numpy._core._rational_tests import rational
  from numpy.testing import assert_array_equal, assert_warns, IS_PYPY
label_desc: Use image node_id 4 for calling the TestArrayLikes obj's underlying member method code with example usage: obj.test_arraylike_classes() without return types