STINNER Victor <vstin...@python.org> added the comment:

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?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43908>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to