Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Argument Clinic: list the definitions of a C file #155263

Description

@serhiy-storchaka

Feature or enhancement

Sub-issue of #108643.

Add a --list option which prints the modules, classes and functions which Argument Clinic defines in the specified files, each function with its signature, and writes nothing:

$ ./python Tools/clinic/clinic.py --list Modules/_collectionsmodule.c
Modules/_collectionsmodule.c
  class _tuplegetter
    _tuplegetter(index, doc, /)
  module _collections
    _collections._count_elements($module, mapping, iterable, /)
    class _collections.deque
      _collections.deque.rotate($self, n=1, /)
      _collections.deque.index($self, value, [start, [stop]])
      _collections.deque([iterable[, maxlen]])

__new__() and __init__() are shown as a call of the class. @getter and @setter have no signature, so they are shown as getter <name> and setter <name>.

It works with --make, so --list --make --srcdir . lists everything which Argument Clinic defines in the tree.

It also makes the parsed data reachable from the command line, which the remaining items of #108643 need.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions