Everyone has access not only 'equivalent' but also 'exact' code.
Go to https://github.com/python/cpython/blob/m...inmodule.c and look for builtin_all. For your convenience it's provided below (I am not C-man myself so I have no idea what does it mean ):
Go to https://github.com/python/cpython/blob/m...inmodule.c and look for builtin_all. For your convenience it's provided below (I am not C-man myself so I have no idea what does it mean ):
static PyObject * builtin_all(PyObject *module, PyObject *iterable) /*[clinic end generated code: output=ca2a7127276f79b3 input=1a7c5d1bc3438a21]*/ { PyObject *it, *item; PyObject *(*iternext)(PyObject *); int cmp; it = PyObject_GetIter(iterable); if (it == NULL) return NULL; iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); if (item == NULL) break; cmp = PyObject_IsTrue(item); Py_DECREF(item); if (cmp < 0) { Py_DECREF(it); return NULL; } if (cmp == 0) { Py_DECREF(it); Py_RETURN_FALSE; } } Py_DECREF(it); if (PyErr_Occurred()) { if (PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); else return NULL; } Py_RETURN_TRUE; }
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.