Message 347295 - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Content
Currently, `test_pycfunction` picks a few built-in functions with various calling conventions to exercise all the relevant code paths:

        for py_name, py_args, c_name, expected_frame_number in (
            ('gmtime', '', 'time_gmtime', 1),  # METH_VARARGS
            ('len', '[]', 'builtin_len', 2),  # METH_O
            ...

See: https://github.com/python/cpython/blob/2f19e82fbe98ce86bcd98a176328af2808b678e8/Lib/test/test_gdb.py#L851

These calling conventions are not a guaranteed part of the interface, and as such these tests are fragile (as we saw in GH-14311, when converting the time module to use Argument Clinic changed gmtime from METH_VARARGS to METH_FASTCALL). Per Victor's suggestion in GH-14330, I think we should expose a few test functions in the `testcapi` module as exemplars of their respective calling conventions and use those, rather than arbitrary builtins.