← 返回首页
Make the correct `call` specialization fail kind show up · Issue #99770 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Make the correct call specialization fail kind show up #99770

New issue
New issue

Description

The SPEC_FAIL_KIND is not displayed correctly due to not being adequately maintained.
e.g

cpython/Python/specialize.c

Lines 1471 to 1482 in b1dcdef

#ifdef Py_STATS
static int
builtin_call_fail_kind(int ml_flags)
{
switch (ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O |
METH_KEYWORDS | METH_METHOD)) {
case METH_VARARGS:
return SPEC_FAIL_CALL_PYCFUNCTION;
case METH_VARARGS | METH_KEYWORDS:
return SPEC_FAIL_CALL_PYCFUNCTION_WITH_KEYWORDS;
case METH_FASTCALL | METH_KEYWORDS:
return SPEC_FAIL_CALL_PYCFUNCTION_FAST_WITH_KEYWORDS;

According to the context, METH_FASTCALL | METH_KEYWORDS flag does not cause specialization failure.
However, the method descr fail kind will also be shown as SPEC_FAIL_CALL_PYCFUNCTION, because builtin_call_fail_kind function is called incorrectly in the specialize_method_descriptor function.

I'd like to submit a PR to fix them and make them display correctly.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    • Open in GitHub Copilot app

    Footer

    © 2026 GitHub, Inc.