This adds a test to try to recreate the NumPy DType type hierarchy. It takes the type spec from scalartypes.c.src and the double-inheritance from multiarraymodule.c to create a float64 dtype. It is locally failing to create the correct tpye heirarchy, which on NumPy is
but in this test is only [<class 'float'>, <class 'object'>]. I am not sure why that is.
It then has two methods for creating a new float64 object: via calling, i.e. float64(n), and via using the tp_alloc slot from the PyTypeObject, like in PyArray_Scalar. This currently fails on PyPy, for a myriad of reasons, which is why I wanted a stand alone test to replicate the type creation.
This adds a test to try to recreate the NumPy DType type hierarchy. It takes the type spec from scalartypes.c.src and the double-inheritance from multiarraymodule.c to create a
float64
dtype. It is locally failing to create the correct tpye heirarchy, which on NumPy isbut in this test is only
[<class 'float'>, <class 'object'>]
. I am not sure why that is.It then has two methods for creating a new
float64
object: via calling, i.e.float64(n)
, and via using thetp_alloc
slot from thePyTypeObject
, like inPyArray_Scalar
. This currently fails on PyPy, for a myriad of reasons, which is why I wanted a stand alone test to replicate the type creation.Any thoughts are welcome.