don't worry about any self-referring tuples.
PyObject *s, *temp;
PyObject *pieces, *result = NULL;
+ n = Py_Size(v);
+ if (n == 0)
+ return PyString_FromString("()");
+
/* While not mutable, it is still possible to end up with a cycle in a
tuple through an object that stores itself within a tuple (and thus
infinitely asks for the repr of itself). This should only be
return i > 0 ? PyString_FromString("(...)") : NULL;
}
- n = Py_Size(v);
- if (n == 0)
- return PyString_FromString("()");
-
pieces = PyTuple_New(n);
if (pieces == NULL)
return NULL;