Mercurial > cpython-lru_cache-weakref
diff Objects/setobject.c @ 42477:e7fd327e0c19
Kill all uses and definitions of tp_print under Objects/. (Others will follow.)
Finally kill intobject.c, which was #ifdef'ed out a long time ago.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 07 Aug 2007 19:51:00 +0000 |
| parents | c8b850b5a066 |
| children | 4dea3b68b013 |
line wrap: on
line diff
--- a/Objects/setobject.c Tue Aug 07 19:42:11 2007 +0000 +++ b/Objects/setobject.c Tue Aug 07 19:51:00 2007 +0000 @@ -565,50 +565,6 @@ Py_TRASHCAN_SAFE_END(so) } -static int -set_tp_print(PySetObject *so, FILE *fp, int flags) -{ - setentry *entry; - Py_ssize_t pos=0; - char *emit = ""; /* No separator emitted on first pass */ - char *separator = ", "; - int literalform = 0; - int status = Py_ReprEnter((PyObject*)so); - - if (status != 0) { - if (status < 0) - return status; - fprintf(fp, "%s(...)", Py_Type(so)->tp_name); - return 0; - } - - if (!so->used) { - Py_ReprLeave((PyObject*)so); - fprintf(fp, "%s()", Py_Type(so)->tp_name); - return 0; - } - - if (Py_Type(so) == &PySet_Type) { - literalform = 1; - fprintf(fp, "{"); - } else - fprintf(fp, "%s([", Py_Type(so)->tp_name); - while (set_next(so, &pos, &entry)) { - fputs(emit, fp); - emit = separator; - if (PyObject_Print(entry->key, fp, 0) != 0) { - Py_ReprLeave((PyObject*)so); - return -1; - } - } - if (literalform) - fputs("}", fp); - else - fputs("])", fp); - Py_ReprLeave((PyObject*)so); - return 0; -} - static PyObject * set_repr(PySetObject *so) { @@ -1957,7 +1913,7 @@ 0, /* tp_itemsize */ /* methods */ (destructor)set_dealloc, /* tp_dealloc */ - (printfunc)set_tp_print, /* tp_print */ + 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ set_nocmp, /* tp_compare */ @@ -2050,7 +2006,7 @@ 0, /* tp_itemsize */ /* methods */ (destructor)set_dealloc, /* tp_dealloc */ - (printfunc)set_tp_print, /* tp_print */ + 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ set_nocmp, /* tp_compare */
