summaryrefslogtreecommitdiff
path: root/Objects/setobject.c
diff options
context:
space:
mode:
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 a5366c89bf..14d9155481 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 */