Commit 17f093a1 authored by David Gobbi's avatar David Gobbi Committed by Marcus D. Hanwell
Browse files

ENH: cleaner repr() for PyVTKSpecialObject

parent 8dcb00ed
......@@ -46,10 +46,11 @@ static PyObject *PyVTKSpecialObject_PyString(PyVTKSpecialObject *self)
static PyObject *PyVTKSpecialObject_PyRepr(PyVTKSpecialObject *self)
char buf[255];
sprintf(buf,"<%s %s at %p>", self->ob_type->tp_name,
PyString_AsString(self->vtk_info->classname), self);
return PyString_FromString(buf);
vtksys_ios::ostringstream os;
os << "(" << PyString_AS_STRING(self->vtk_info->classname) << ")";
self->vtk_info->print_func(os, self->vtk_ptr);
const vtksys_stl::string &s = os.str();
return PyString_FromStringAndSize(, s.size());
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment