From: Joachim Dahl on
My mistake seems to be that I declared

char a, b;

instead of

int a, b;

Thank you for sorting this out.

Joachim
From: casevh on
On Dec 18, 10:28 am, Joachim Dahl <dahl.joac...(a)gmail.com> wrote:
> My mistake seems to be that I declared
>
> char a, b;
>
> instead of
>
> int a, b;
>
> Thank you for sorting this out.
>
> Joachim

I think you need to initialize them, too.
From: Gabriel Genellina on
En Sat, 19 Dec 2009 07:36:59 -0300, Emeka <emekamicro(a)gmail.com> escribi�:

> Okay if that is the case, why do we need it? By having int a = 65, b =
> 66 ,
> why should we also have *kwlist[]?
>
>
>
> static PyObject* foo(PyObject *self, PyObject *args, PyObject *kwrds)
> {
> int a=65, b=66;
> char *kwlist[] = {"a", "b", NULL};
> if (!PyArg_ParseTupleAndKeywords(args, kwrds, "|CC", kwlist, &a,
> &b))
> return NULL;
> return Py_BuildValue("(CC)", a, b);
> }

It's not related to default values. foo(x=30) should raise an error; the
allowed parameter names are only 'a' and 'b', not 'x'.

--
Gabriel Genellina