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 <>
> 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];
        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.
Date User Action Args
2016-04-19 16:15:28llllllllllsetrecipients: + llllllllll, vstinner, martin.panter, serhiy.storchaka, yselivanov
2016-04-19 16:15:28llllllllllsetmessageid: <>
2016-04-19 16:15:28lllllllllllinkissue26802 messages
2016-04-19 16:15:28llllllllllcreate