Missing code updates in the previous commit.
Also improved __repr__() so that the .getName() is no longer necessary in user-defined Function0D and Function1D subclasses.
This commit is contained in:
@@ -93,7 +93,7 @@ static void UnaryFunction0DFloat___dealloc__(BPy_UnaryFunction0DFloat* self)
|
||||
|
||||
static PyObject * UnaryFunction0DFloat___repr__(BPy_UnaryFunction0DFloat* self)
|
||||
{
|
||||
return PyUnicode_FromFormat("type: %s - address: %p", self->uf0D_float->getName().c_str(), self->uf0D_float);
|
||||
return PyUnicode_FromFormat("type: %s - address: %p", Py_TYPE(self)->tp_name, self->uf0D_float);
|
||||
}
|
||||
|
||||
static PyObject * UnaryFunction0DFloat___call__(BPy_UnaryFunction0DFloat *self, PyObject *args, PyObject *kwds)
|
||||
@@ -103,7 +103,7 @@ static PyObject * UnaryFunction0DFloat___call__(BPy_UnaryFunction0DFloat *self,
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj))
|
||||
return NULL;
|
||||
|
||||
|
||||
if (typeid(*(self->uf0D_float)) == typeid(UnaryFunction0D<float>)) {
|
||||
PyErr_SetString(PyExc_TypeError, "__call__ method not properly overridden");
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user