\begin{funcdesc}{instancemethod}{function, instance, class}
This function will return a method object, bound to \var{instance}, or
unbound if \var{instance} is \code{None}. \var{function} must be
-callable, and \var{instance} must be an instance object or
-\code{None}.
+callable.
\end{funcdesc}
\begin{funcdesc}{function}{code, globals\optional{, name\optional{, argdefs}}}
PyObject* self;
PyObject* classObj;
- if (!PyArg_ParseTuple(args, "OOO!:instancemethod",
- &func,
- &self,
- &PyClass_Type, &classObj))
+ if (!PyArg_ParseTuple(args, "OOO:instancemethod",
+ &func, &self, &classObj))
return NULL;
if (!PyCallable_Check(func)) {
PyErr_SetString(PyExc_TypeError,
}
if (self == Py_None)
self = NULL;
- else if (!PyInstance_Check(self)) {
- PyErr_SetString(PyExc_TypeError,
- "second argument must be instance or None");
- return NULL;
- }
return PyMethod_New(func, self, classObj);
}