// src/tri/_tri_wrapper.cpp
static HPy PyTriangulation_calculate_plane_coefficients(
HPyContext *ctx, HPy h_self, HPy* args, HPy_ssize_t nargs, HPy kwds)
{
Triangulation::CoordinateArray z;
+ PyTriangulation* self = PyTriangulation_AsStruct(ctx, h_self);
+ HPy h_z;
+ if (!HPyArg_Parse(ctx, NULL, args, nargs, "O:calculate_plane_coefficients", &h_z)) {
+ return HPy_NULL;
+ }
+ if (!z.converter(HPy_AsPyObject(ctx, h_z), &z)) {
...
+ return HPy_NULL;
+ }
- if (!PyArg_ParseTuple(args, "O&:calculate_plane_coefficients",
- &z.converter, &z)) {
- return NULL;
- }
...
}
-
-
Save qunaibit/c9b7c8a8637c84ce30dd33a107b94b0b to your computer and use it in GitHub Desktop.
HPy arg parser
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment