Message362383
This is my code for math.gcd:
static PyObject *
math_gcd(PyObject *module, PyObject *args, Py_ssize_t n)
{
PyObject *g = 0, *item, *in;
Py_ssize_t i;
for (i = 0; i < n; i++) {
item = args[i];
in = PyNumber_Index(item);
if (in == NULL) {
return NULL;
}
g = _PyLong_GCD(g, in);
}
Py_DECREF(in);
return g;
}
This is showing an error:
error: incompatible types when assigning to type ‘PyObject * {aka struct _object *}’ from type ‘PyObject {aka struct _object}’
item = args[i];
^^^ |
|
Date |
User |
Action |
Args |
2020-02-21 06:41:40 | Ananthakrishnan | set | recipients:
+ Ananthakrishnan, tim.peters, rhettinger, mark.dickinson, steven.daprano, SilentGhost, serhiy.storchaka, Dennis Sweeney, BernardoSulzbach |
2020-02-21 06:41:40 | Ananthakrishnan | set | messageid: <1582267300.85.0.976877475485.issue39648@roundup.psfhosted.org> |
2020-02-21 06:41:40 | Ananthakrishnan | link | issue39648 messages |
2020-02-21 06:41:40 | Ananthakrishnan | create | |
|