How to catch a usefull error message ?

Gregory Ewing greg.ewing at
Thu Apr 25 03:00:29 EDT 2019

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

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,
             return -1;

See that?


More information about the Python-list mailing list