Skip to content

Test Limited API in _testcapi module #95991

Closed
@encukou

Description

@encukou

The Limited API is currently tested in xxlimited module(s), which isn't a great location since the module serves as a “tutorial” example of how to make a module. There's no room for advanced stuff or edge cases.
Testing Limited API together with other C API is complicated, because:

  • Limited API needs to be enabled per source file
  • Some builds don't support Limited API, so Limited API tests must be skipped on those builds.
    (Currently this is Py_TRACE_REFS, but that may change.)
  • Py_LIMITED_API must be defined before <Python.h> is included.

With #95505 (splitting _testcapi module into several source files), the first complication is solved. I'd like to add helpers for the others, to make testing Limited API easy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions