Author vstinner
Recipients Guido.van.Rossum, Mark.Shannon, christian.heimes, corona10, erlendaasland, gvanrossum, pablogsal, serhiy.storchaka, shihai1991, shreyanavigyan, vstinner
Date 2021-04-30.11:05:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619780725.49.0.922567755042.issue43908@roundup.psfhosted.org>
In-reply-to
Content
PyStdPrinter_Type implements tp_new, but tp_init always fail:

static int
stdprinter_init(PyObject *self, PyObject *args, PyObject *kwds)
{
    PyErr_SetString(PyExc_TypeError,
                    "cannot create 'stderrprinter' instances");
    return -1;
}

Maybe it should use the Py_TPFLAGS_IMMUTABLETYPE flag instead?

Instances must be created with PyFile_NewStdPrinter() which doesn't use tp_new nor tp_init.

Erlend: do you want to propose a PR?
History
Date User Action Args
2021-04-30 11:05:25vstinnersetrecipients: + vstinner, gvanrossum, christian.heimes, Mark.Shannon, serhiy.storchaka, Guido.van.Rossum, corona10, pablogsal, shihai1991, erlendaasland, shreyanavigyan
2021-04-30 11:05:25vstinnersetmessageid: <1619780725.49.0.922567755042.issue43908@roundup.psfhosted.org>
2021-04-30 11:05:25vstinnerlinkissue43908 messages
2021-04-30 11:05:25vstinnercreate