This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author arhadthedev
Recipients arhadthedev, larry
Date 2022-03-26.12:59:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648299568.03.0.403379659681.issue47128@roundup.psfhosted.org>
In-reply-to
Content
The attached PR makes the following possible (note that the impl has a `void` return type):

    /*[clinic input]
    _io._IOBase.writelines -> NoneType
        lines: object
        /
    [clinic start generated code]*/

    static void
    _io__IOBase_writelines_impl(PyObject *self, PyObject *lines)
    /*[clinic end generated code: output=f3feca36db72dbd1 input=286ba711cb7291ad]*/

Previously, the return type would be `Object *` with generated replacement of non-Py_None values to NULL on the other side.

So now there is no need to track whether NULL or Py_None should be returned. Or should it be Py_RETURN_NONE? Argument Clinic does it by itself returning NULL on errors and PyNone otherwise:

    static PyObject *
    _io__IOBase_writelines(PyObject *self, PyObject *lines)
    {
        PyObject *return_value = NULL;

        _io__IOBase_writelines_impl(self, lines);
        if (PyErr_Occurred()) {
            goto exit;
        }
        return_value = Py_None;
        Py_INCREF(Py_None);

    exit:
        return return_value;
    }
History
Date User Action Args
2022-03-26 12:59:28arhadthedevsetrecipients: + arhadthedev, larry
2022-03-26 12:59:28arhadthedevsetmessageid: <1648299568.03.0.403379659681.issue47128@roundup.psfhosted.org>
2022-03-26 12:59:28arhadthedevlinkissue47128 messages
2022-03-26 12:59:27arhadthedevcreate