summaryrefslogtreecommitdiffstats
path: root/Objects/setobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-07 19:51:00 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-07 19:51:00 (GMT)
commit04dbf3b5ec618956c9df58ce1d6e3dc089f5f095 (patch)
tree034a834eb78fe400f52aeaa3eb2cd663e7a78ccd /Objects/setobject.c
parentd474ce8c7a46edb5ab12c616cd307ab34699a816 (diff)
downloadcpython-04dbf3b5ec618956c9df58ce1d6e3dc089f5f095.zip
cpython-04dbf3b5ec618956c9df58ce1d6e3dc089f5f095.tar.gz
cpython-04dbf3b5ec618956c9df58ce1d6e3dc089f5f095.tar.bz2
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.
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r--Objects/setobject.c48
1 files changed, 2 insertions, 46 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index a5366c8..14d9155 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -565,50 +565,6 @@ set_dealloc(PySetObject *so)
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 @@ PyTypeObject PySet_Type = {
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 @@ PyTypeObject PyFrozenSet_Type = {
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 */