Skip to content

Argument Clinic docstring generator ignores a custom name for $module argument #94246

Closed as not planned
@arhadthedev

Description

@arhadthedev

Input file

/*[clinic input]
my_method
    _foo: self(type="PyObject *")
    module: object
[clinic start generated code]*/

python Tools/clinic/clinic.py test.c

Current result

/*[clinic input]
preserve
[clinic start generated code]*/

PyDoc_STRVAR(my_method__doc__,
"my_method($module, /, module)\n"
"--\n"
"\n");

[snip]

my_method__doc__ continues to list renamed _foo as $module.

Expected result

-"my_method($module, /, module)\n"
+"my_method($_foo, /, module)\n"

A docstring should use an actual module/self variable name to not confuse docstring readers; its special role is denoted by $ prefix and position anyway.

This issue is a blocker for #92891 (comment).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions