Skip to content

gh-76595: Add note on PyCapsule_Import behavior #134022

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Doc/c-api/capsule.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ Refer to :ref:`using-capsules` for more information on using these objects.
Return the capsule's internal *pointer* on success. On failure, set an
exception and return ``NULL``.

.. note::

:c:func:`PyCapsule_Import` splits *name* on the ``.`` character, and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already know that it's PyCapsule_Import:

Suggested change
:c:func:`PyCapsule_Import` splits *name* on the ``.`` character, and
This function splits *name* on the ``.`` character, and

imports the first element. It then processes further elements using
attribute lookups. As a result, if *name* points to an attribute in
some submodule or subpackage, this submodule or subpackage must be
previously imported using other means (e.g. by using :c:func:`PyImport_ImportModule`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
previously imported using other means (e.g. by using :c:func:`PyImport_ImportModule`).
previously imported using other means (for example, by using :c:func:`PyImport_ImportModule`).

Style guide

Also needs to be wrapped.


.. versionchanged:: 3.3
*no_block* has no effect anymore.

Expand Down
Loading