diff options
author | Matti Picus <matti.picus@gmail.com> | 2016-09-29 21:42:11 +0300 |
---|---|---|
committer | Matti Picus <matti.picus@gmail.com> | 2016-10-01 19:21:25 +0300 |
commit | 2f1a5b9801c380a0e85760fcd76fc70b03312337 (patch) | |
tree | 3cb7a9db7a5d5cde632b1df451d4b2e27d9c11ab /numpy/core | |
parent | cac80b81702da8816a4cb0925233f0bd9e64837a (diff) | |
download | numpy-2f1a5b9801c380a0e85760fcd76fc70b03312337.tar.gz |
ENH: pypy needs a basic tp_as_number at PyType_Ready in order to allow overriding function pointers
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/src/multiarray/scalartypes.c.src | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src index 5054fa850..19f2a6b03 100644 --- a/numpy/core/src/multiarray/scalartypes.c.src +++ b/numpy/core/src/multiarray/scalartypes.c.src @@ -2837,6 +2837,15 @@ static PyObject * } /**end repeat**/ +/**begin repeat + * #name = half, float, double, longdouble, + * cfloat, cdouble, clongdouble# + * #NAME = Half, Float, Double, LongDouble, + * CFloat, CDouble, CLongDouble# + */ +static PyNumberMethods @name@_arrtype_as_number; +/**end repeat**/ + static PyObject * bool_index(PyObject *a) { @@ -4094,6 +4103,18 @@ initialize_numeric_types(void) Py@NAME@ArrType_Type.tp_as_number->nb_index = (unaryfunc)@name@_index; /**end repeat**/ + + /**begin repeat + * #name = half, float, double, longdouble, + * cfloat, cdouble, clongdouble# + * #NAME = Half, Float, Double, LongDouble, + * CFloat, CDouble, CLongDouble# + */ + @name@_arrtype_as_number = gentype_as_number; + Py@NAME@ArrType_Type.tp_as_number = &@name@_arrtype_as_number; + + /**end repeat**/ + PyBoolArrType_Type.tp_as_number->nb_index = (unaryfunc)bool_index; PyStringArrType_Type.tp_alloc = NULL; |