mongodb-labs / python-bsonjs

A fast BSON to MongoDB Extended JSON converter for Python - This Repository is NOT a supported MongoDB product
Apache License 2.0
40 stars 10 forks source link

Fix PyMethodDef warnings resolve #42 #49

Closed ShaneHarvey closed 1 year ago

ShaneHarvey commented 1 year ago

Resolves https://github.com/mongodb-labs/python-bsonjs/issues/42

See https://docs.python.org/3/extending/extending.html?highlight=meth_varargs%20meth_keywords#keyword-parameters-for-extension-functions:

static PyMethodDef keywdarg_methods[] = {
    /* The cast of the function is necessary since PyCFunction values
     * only take two PyObject* parameters, and keywdarg_parrot() takes
     * three.
     */
    {"parrot", (PyCFunction)(void(*)(void))keywdarg_parrot, METH_VARARGS | METH_KEYWORDS,
     "Print a lovely skit to standard output."},
    {NULL, NULL, 0, NULL}   /* sentinel */
};