| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
The Doctest job fails with: sphinx.errors.SphinxParallelError: sphinx.errors.ExtensionError: Handler <function add_annotations at 0x7af8150d5fd0> for event 'doctree-read' threw an exception (exception: Object type mismatch in limited API annotation for PyObject_New: 'function' != 'macro') I documented PyObject_New() as a function in stable_abi.toml ([function.PyObject_New]) to fix to fix Doctest, but it doesn't work as expected. Problem: macros declared as functions by stable_abi.toml are checked by Lib/test/test_stable_abi_ctypes.py which fails since they are macros and not functions... |
Sorry, something went wrong.
|
I updated the PR to document all macros as macros, not as functions. |
Sorry, something went wrong.
|
Updated Doctest error: sphinx.errors.SphinxParallelError: sphinx.errors.ExtensionError: Handler <function add_annotations at 0x7353c3fd9fd0> for event 'doctree-read' threw an exception (exception: Object type mismatch in limited API annotation for PyImport_ImportModuleEx: 'macro' != 'function') |
Sorry, something went wrong.
Documentation build overview33 files changed · ± 33 modified ± Modified |
Sorry, something went wrong.
|
I updated Doc/tools/extensions/c_annotations.py to accept that some documented functions are defined as macros by stable_abi.toml. |
Sorry, something went wrong.
Sorry, something went wrong.
I created #158941 to add some macros.
Ok.
For end users (developers using of the limited CAPI), I don't think that it makes a big difference if a function is implemented as a macro or as a function. In the limited C API, it's the same. I like how some macros are documented as function to show parameter types and return type, that's nice!
I think that it's fine to not document some special macros, but Misc/stable_abi.toml should be complete since it's used by tools to check if a C extension uses correctly the limited C API / stable ABI, no? Note: https://docs.python.org/dev/c-api/intro.html#c.PyAPI_DATA and https://docs.python.org/dev/c-api/intro.html#c.Py_ULL are documented.
Py_IS_FINITE() is a deprecated alias to isfinite(): // Py_IS_FINITE(X)
// Return 1 if float or double arg is neither infinite nor NAN, else 0.
// Soft deprecated since Python 3.14, use isfinite() instead.
#define Py_IS_FINITE(X) isfinite(X)It's documented: https://docs.python.org/dev/c-api/float.html#c.Py_IS_FINITE. What should we not add it to stable_abi.toml? It's just a fact that it's part of the limited C API.
Ok, later I will prepare a PR focused on Check functions. |
Sorry, something went wrong.
|
I mark this PR as a draft. I will split it into smaller PRs, as suggested by @encukou. |
Sorry, something went wrong.
That's true! But there are also users of the Stable ABI that don't use C, such as (our) ctypes.pythonapi or (practical) PyO3.
Yes! I just want to be clear that they're not in the ABI :)
No. PEP 652 specifically says about the manifest (which is now named Misc/stable_abi.toml):
Discrepancies between the TOML file and what's actually exposed are bugs. They might be bugs in the manifest, but they might also be bugs in the headers. The manifest was initially generated from PC/python3dll.c so the ABI list is ~complete, but macros are added manually so a bunch of them is missing.
Since these are all the same, it might make sense to add one common description and link it everywhere. |
Sorry, something went wrong.
Since you have an idea on how these Check functions should be document, oh sure, go ahead! This PR should contain all Check functions which are part of the limited C API and are not documented in stable_abi.toml yet. So you can check the list. |
Sorry, something went wrong.
|
Hmm, turns out I already started on that, for capi-workgroup/decisions#115 :) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.