[pygtk] Diiference between method and a function

varun_shrivastava shrivastavavarun at yahoo.co.in
Thu Jun 14 17:42:39 WST 2007


hi

i was reading about how to define a wrapper function
it looks like 

static PyObject *
spam_system(PyObject *self, PyObject *args)
{
    const char *command;
    int sts;

    if (!PyArg_ParseTuple(args, "s", &command))
        return NULL;
    sts = system(command);
    return Py_BuildValue("i", sts);
}

and then i couldn't understand this line

"The self argument is only used when the C function implements a built-in
method, not a function. In the example, self will always be a NULL pointer,
since we are defining a function, not a method."

what is built in method ?

thanks 


-- 
View this message in context: http://www.nabble.com/Diiference-between-method-and-a-function-tf3920530.html#a11116493
Sent from the Gtk+ - Python mailing list archive at Nabble.com.



More information about the pygtk mailing list