Vincent Vande Vyvre wrote:
But the "return 0" is a common case for an "Foo_init()"

see: https://docs.python.org/3.5//extending/newtypes.html#adding-data-and-methods-to-the-basic-example

Look carefully at the init function from that example:

    static int
    Noddy_init(Noddy *self, PyObject *args, PyObject *kwds)
    {
        PyObject *first=NULL, *last=NULL, *tmp;

        static char *kwlist[] = {"first", "last", "number", NULL};

        if (! PyArg_ParseTupleAndKeywords(args, kwds, "|OOi", kwlist,
                                      &first, &last,
                                      &self->number))
            return -1;
            ^^^^^^^^^

See that?

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to