8000 Merge pull request #8103 from mattip/pypy-fixes · numpy/numpy@dbb7094 · GitHub
[go: up one dir, main page]

Skip to content

Commit dbb7094

Browse files
authored
Merge pull request #8103 from mattip/pypy-fixes
Pypy fixes
2 parents b0159a9 + 2f9f10a commit dbb7094

File tree

5 files changed

+82
-61
lines changed

5 files changed

+82
-61
lines changed

numpy/core/src/multiarray/scalartypes.c.src

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2837,6 +2837,15 @@ static PyObject *
28372837
}
28382838
/**end repeat**/
28392839

2840+
/**begin repeat
2841+
* #name = half, float, double, longdouble,
2842+
* cfloat, cdouble, clongdouble#
2843+
* #NAME = Half, Float, Double, LongDouble,
2844+
* CFloat, CDouble, CLongDouble#
2845+
*/
2846+
static PyNumberMethods @name@_arrtype_as_number;
2847+
/**end repeat**/
2848+
28402849
static PyObject *
28412850
bool_index(PyObject *a)
28422851
{
@@ -4094,6 +4103,18 @@ initialize_numeric_types(void)
40944103
Py@NAME@ArrType_Type.tp_as_number->nb_index = (unaryfunc)@name@_index;
40954104

40964105
/**end repeat**/
4106+
4107+
/**begin repeat
4108+
* #name = half, float, double, longdouble,
4109+
* cfloat, cdouble, clongdouble#
4110+
* #NAME = Half, Float, Double, LongDouble,
4111+
* CFloat, CDouble, CLongDouble#
4112+
*/
4113+
@name@_arrtype_as_number = gentype_as_number;
4114+
Py@NAME@ArrType_Type.tp_as_number = &@name@_arrtype_as_number;
4115+
4116+
/**end repeat**/
4117+
40974118
PyBoolArrType_Type.tp_as_number->nb_index = (unaryfunc)bool_index;
40984119

40994120
PyStringArrType_Type.tp_alloc = NULL;

numpy/core/src/multiarray/shape.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ PyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape, int refcheck,
9393
"Use the resize function or refcheck=False");
9494

9595
return NULL;
96-
#else
96+
#else
9797
refcnt = PyArray_REFCOUNT(self);
98-
#endif
98+
#endif /* PYPY_VERSION */
9999
}
100100
else {
101101
refcnt = 1;

0 commit comments

Comments
 (0)
0