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 llllllllll
Recipients llllllllll, martin.panter, serhiy.storchaka, vstinner, yselivanov
Date 2016-04-19.16:15:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1461082528.24.0.536721239091.issue26802@psf.upfronthosting.co.za>
In-reply-to
Content
> It's possible that stararg is already an empty tuple. Is it worth to use it?

PyTuple_New(0) should return the unit tuple in most cases:

#if PyTuple_MAXSAVESIZE > 0
    if (size == 0 && free_list[0]) {
        op = free_list[0];
        Py_INCREF(op);
#ifdef COUNT_ALLOCS
        tuple_zero_allocs++;
#endif
        return (PyObject *) op;
    }


Looking at this again I think that checking if stararg is nonnull is more clear, I will update the patch (as call-function-var-3.patch). I cannot exactly rewrite the if to use the control flow you show because that would cause non-tuple subclasses to forward a stararg of () instead of copying it into a normal tuple when no arguments are passed ont the stack.
History
Date User Action Args
2016-04-19 16:15:28llllllllllsetrecipients: + llllllllll, vstinner, martin.panter, serhiy.storchaka, yselivanov
2016-04-19 16:15:28llllllllllsetmessageid: <1461082528.24.0.536721239091.issue26802@psf.upfronthosting.co.za>
2016-04-19 16:15:28lllllllllllinkissue26802 messages
2016-04-19 16:15:28llllllllllcreate