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