Author mark.dickinson
Recipients brandtbucher, mark.dickinson, rhettinger
Date 2022-01-13.08:43:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642063433.5.0.123050005077.issue46361@roundup.psfhosted.org>
In-reply-to
Content
Hmm. This sort of thing is a little dodgy, though (despite the comment that it's "okay"): 

https://github.com/python/cpython/blob/1de60155d5d01be2924e72fb68dd13d4fd00acd7/Modules/mathmodule.c#L939

    PyObject *zero = _PyLong_GetZero();  // borrowed ref
    for (i = 1; i < nargs; i++) {
        /* --- 8< --- snipped code */
        if (res == zero) {
            /* Fast path: just check arguments.
               It is okay to use identity comparison here. */
            Py_DECREF(x);
            continue;
        }
        /* --- 8< --- snipped code*/
    }
History
Date User Action Args
2022-01-13 08:43:53mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, brandtbucher
2022-01-13 08:43:53mark.dickinsonsetmessageid: <1642063433.5.0.123050005077.issue46361@roundup.psfhosted.org>
2022-01-13 08:43:53mark.dickinsonlinkissue46361 messages
2022-01-13 08:43:53mark.dickinsoncreate