Skip to content

Commit

Permalink
Make array generic. (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
esoma authored Oct 10, 2024
1 parent 8fc0482 commit 37cd9d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PyGLM/types/glmArray/forward_declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ PyDoc_STRVAR(glmArray_setstate_docstr,

static PyObject* glmArray_setstate(glmArray* self, PyObject* state);

PyDoc_STRVAR(glmArray_class_getitem_docstr,
"See PEP 585"
);

PyDoc_STRVAR(glmArray_filter_docstr,
"filter(func: callable) -> array\n"
" Filters this array with the given funtion and returns the resulting array.\n"
Expand Down
3 changes: 3 additions & 0 deletions PyGLM/types/glmArray/glmArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ static PyMethodDef glmArray_methods[] = {
{ "__deepcopy__", (PyCFunction)generic_deepcopy, METH_O, generic_deepcopy_docstr },
{ "__getstate__", (PyCFunction)glmArray_getstate, METH_NOARGS, glmArray_getstate_docstr },
{ "__setstate__", (PyCFunction)glmArray_setstate, METH_O, glmArray_setstate_docstr },
#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 9
{ "__class_getitem__", Py_GenericAlias, METH_O | METH_CLASS, glmArray_class_getitem_docstr },
#endif
{ "to_bytes", (PyCFunction)glmArray_to_bytes, METH_NOARGS, glmArray_to_bytes_docstr },
{ "from_bytes", (PyCFunction)glmArray_from_bytes, METH_VARARGS | METH_STATIC, glmArray_from_bytes_docstr },
{ "reinterpret_cast",(PyCFunction)glmArray_reinterpret_cast,METH_O, glmArray_reinterpret_cast_docstr },
Expand Down

0 comments on commit 37cd9d9

Please sign in to comment.