Skip to content

The docstrings for PyMapping_Values, PyMapping_Items and PyMapping_Keys are incorrect #119391

@eendebakpt

Description

@eendebakpt

Documentation

The docstring for PyMapping_Keys

/* On success, return a list or tuple of the keys in mapping object 'o'.

does not reflect the documentation (see https://docs.python.org/3/c-api/mapping.html#c.PyMapping_Keys) or the implementation (see abstract.c#L2519) as PyMapping_Keys can only return a list. Similar for the other methods.

The docstrings show up in IDEs (such as Visual Studio Code) and can cause confusion. I encountered this when working on the making the json module compatible with free-threading

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions