8000 ENH: Pypy fixes by mattip · Pull Request #8103 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Pypy fixes #8103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 8, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ENH: pypy needs a basic tp_as_number at PyType_Ready in order to allo…
…w overriding function pointers
  • Loading branch information
mattip committed Oct 1, 2016
commit 2f1a5b9801c380a0e85760fcd76fc70b03312337
21 changes: 21 additions & 0 deletions numpy/core/src/multiarray/scalartypes.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down
0