Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3cd04fc

Browse filesBrowse files
committed
gh-76595: Add note on PyCapsule_Import behavior
There's a PR (GH-6898) which changes this behavior (to be less surprising, I believe), but this seems to have stalled. See: #76595 See: #6898
1 parent e123a1d commit 3cd04fc
Copy full SHA for 3cd04fc

File tree

Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed

‎Doc/c-api/capsule.rst

Copy file name to clipboardExpand all lines: Doc/c-api/capsule.rst
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ Refer to :ref:`using-capsules` for more information on using these objects.
108108
Return the capsule's internal *pointer* on success. On failure, set an
109109
exception and return ``NULL``.
110110
111+
.. note::
112+
113+
:c:func:`PyCapsule_Import` splits *name* on the ``.`` character, and
114+
imports the first element. It then processes further elements using
115+
attribute lookups. As a result, if *name* points to an attribute in
116+
some submodule or subpackage, this submodule or subpackage must be
117+
previously imported using other means (e.g. by using :c:func:`PyImport_ImportModule`).
118+
111119
.. versionchanged:: 3.3
112120
*no_block* has no effect anymore.
113121

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.