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 vstinner
Recipients jdemeyer, vstinner
Date 2019-06-12.13:21:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1560345705.45.0.95611792855.issue37250@roundup.psfhosted.org>
In-reply-to
Content
inherit_slots() uses:

        /* Inherit tp_vectorcall_offset only if tp_call is not overridden */
        if (!type->tp_call) {
            COPYSLOT(tp_vectorcall_offset);
        }

PyType_Ready() contains the following assertion:

    /* Consistency checks for PEP 590:
     * - Py_TPFLAGS_METHOD_DESCRIPTOR requires tp_descr_get
     * - _Py_TPFLAGS_HAVE_VECTORCALL requires tp_call and
     *   tp_vectorcall_offset > 0
     * To avoid mistakes, we require this before inheriting.
     */
    if (type->tp_flags & Py_TPFLAGS_METHOD_DESCRIPTOR) {
        _PyObject_ASSERT((PyObject *)type, type->tp_descr_get != NULL);
    }
    if (type->tp_flags & _Py_TPFLAGS_HAVE_VECTORCALL) {
        _PyObject_ASSERT((PyObject *)type, type->tp_vectorcall_offset > 0);
        _PyObject_ASSERT((PyObject *)type, type->tp_call != NULL);
    }

I understand that tp_vectorcall_offset=0 is fine and the expected value for a type which doesn't have the flag _Py_TPFLAGS_HAVE_VECTORCALL.
History
Date User Action Args
2019-06-12 13:21:45vstinnersetrecipients: + vstinner, jdemeyer
2019-06-12 13:21:45vstinnersetmessageid: <1560345705.45.0.95611792855.issue37250@roundup.psfhosted.org>
2019-06-12 13:21:45vstinnerlinkissue37250 messages
2019-06-12 13:21:45vstinnercreate