Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve module.rst C-API docs #121615

Closed
sobolevn opened this issue Jul 11, 2024 · 0 comments
Closed

Improve module.rst C-API docs #121615

sobolevn opened this issue Jul 11, 2024 · 0 comments
Assignees
Labels
docs Documentation in the Doc dir topic-C-API

Comments

@sobolevn
Copy link
Member

sobolevn commented Jul 11, 2024

There are multiple places in https://github.com/python/cpython/blob/main/Doc/c-api/module.rst where exception are not mentioned in the docs.

Like:

Return 0 on success or -1 on failure.

Some functions do not even declare that they can return NULL. Like:

.. c:function:: PyObject * PyModule_FromDefAndSpec2(PyModuleDef *def, PyObject *spec, int module_api_version)
Create a new module object, given the definition in *def* and the
ModuleSpec *spec*, assuming the API version *module_api_version*.
If that version does not match the version of the running interpreter,
a :exc:`RuntimeWarning` is emitted.
.. note::
Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec`
instead; only use this if you are sure you need it.
.. versionadded:: 3.5

I will send a PR with the fix.

Linked PRs

@sobolevn sobolevn added docs Documentation in the Doc dir topic-C-API labels Jul 11, 2024
@sobolevn sobolevn self-assigned this Jul 11, 2024
sobolevn added a commit to sobolevn/cpython that referenced this issue Jul 11, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 11, 2024
…scriptions (pythonGH-121616)

(cherry picked from commit e6264b4)

Co-authored-by: sobolevn <[email protected]>
sobolevn added a commit to sobolevn/cpython that referenced this issue Jul 11, 2024
…rror descriptions (pythonGH-121616)

(cherry picked from commit e6264b4)

Co-authored-by: sobolevn <[email protected]>
sobolevn added a commit that referenced this issue Jul 11, 2024
sobolevn added a commit that referenced this issue Jul 11, 2024
…escriptions (GH-121616) (#121618)

gh-121615: Improve `module.rst` C-API docs with better error descriptions (GH-121616)
(cherry picked from commit e6264b4)

Co-authored-by: sobolevn <[email protected]>
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir topic-C-API
Projects
None yet
Development

No branches or pull requests

1 participant