Mark Dickinson <dicki...@gmail.com> added the comment:
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*/ } ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46361> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com