How can slot_nb_bool(slot function for __bool__) call __len__?
<p>Python-3.5.1\Objects\typeobject.c</p>

<pre><code>UNSLOT("__bool__", nb_bool, slot_nb_bool, wrap_inquirypred,
       "self != 0"),


static int
slot_nb_bool(PyObject *self)
{
    PyObject *func, *args;
    int result = -1;
    int using_len = 0;
    _Py_IDENTIFIER(__bool__);

    func = lookup_maybe(self, &amp;PyId___bool__);
    if (func == NULL) {
        if (PyErr_Occurred())
            return -1;
        func = lookup_maybe(self, &amp;PyId___len__);
        if (func == NULL)
            return PyErr_Occurred() ? -1 : 1;
        using_len = 1;
    }
...
</code></pre>

<p>In my view, slot function is used only when <strong>__bool__</strong> is defined in python source as follows:</p>

<pre><code>def __bool__(self):
    return True
</code></pre>

<p>if <code>func = lookup_maybe(self, &amp;PyId___bool__);</code> return NULL, it indicates no <code>__bool__</code> is defined. Then slot will not be filled with slot_nb_bool. slot_nb_bool will not be called.</p>

<p>How can slot_nb_bool(slot function for <code>__bool__</code>) call <code>__len__</code>?</p>