threadmodule.c comment error? (from comp.lang.python)

as noted by curtis jensen over at comp.lang.python: the parse tuple string doesn't quite match the error message given if the 2nd argument isn't a tuple. on the other hand, the args argument is initialized to NULL... thread_PyThread_start_new_thread(PyObject *self, PyObject *fargs) { PyObject *func, *args = NULL, *keyw = NULL; struct bootstate *boot; if (!PyArg_ParseTuple(fargs, "OO|O:start_new_thread", &func, &args, &keyw)) return NULL; if (!PyCallable_Check(func)) { PyErr_SetString(PyExc_TypeError, "first arg must be callable"); return NULL; } if (!PyTuple_Check(args)) { PyErr_SetString(PyExc_TypeError, "optional 2nd arg must be a tuple"); return NULL; } if (keyw != NULL && !PyDict_Check(keyw)) { PyErr_SetString(PyExc_TypeError, "optional 3rd arg must be a dictionary"); return NULL; } what's the right way to fix this? (change the error message and remove the initialization, or change the parsetuple string and the tuple check) </F>

I was puzzled until I realized that you mean that error lies about the 2nd arg being optional. I'll remove the word "optional" from the message. --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)

I was puzzled until I realized that you mean that error lies about the 2nd arg being optional. I'll remove the word "optional" from the message. --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
participants (2)
-
Fredrik Lundh
-
Guido van Rossum