docstr: NumPy arrays are read/write which means that anything but invariant
  behaviour is on thin ice.  However, we currently are happy to discover
  subclasses of Python float, int, complex the same as the base classes.
  This should potentially be deprecated.
docstr_tok: ["NumPy","arrays","are","read\/write","which","means","that","anything","but","invariant","behaviour","is","on","thin","ice",".","However",",","we","currently","are","happy","to","discover","subclasses","of","Python","float",",","int",",","complex","the","same","as","the","base","classes",".","This","should","potentially","be","deprecated","."]
code: def test_pyscalar_subclasses(self, pyscalar):
      """NumPy arrays are read/write which means that anything but invariant
      behaviour is on thin ice.  However, we currently are happy to discover
      subclasses of Python float, int, complex the same as the base classes.
      This should potentially be deprecated.
      """
  
      class MyScalar(type(pyscalar)):
          pass
  
      res = np.array(MyScalar(pyscalar))
      expected = np.array(pyscalar)
      assert_array_equal(res, expected)
  
imports: from itertools import permutations, product
  import pytest
  from pytest import param
  import numpy
  from numpy.core._rational_tests import rational
  from numpy.core._multiarray_umath import _discover_array_parameters
  from numpy.testing import assert_array_equal, assert_warns, IS_PYPY
label_desc: Use image node_id 9 for calling the TestScalarDiscovery obj's underlying member method code with example usage: obj.test_pyscalar_subclasses(pyscalar) without return types