Skip to content

[libclang/python][NFC] Document how null cursors are handled #140499

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

Merged
merged 2 commits into from
May 19, 2025

Conversation

Endilll
Copy link
Contributor

@Endilll Endilll commented May 19, 2025

Now that we looked at this aspect closely and fixed things, I think we can document this.

@Endilll Endilll requested a review from DeinAlptraum May 19, 2025 07:06
@Endilll Endilll added the clang:as-a-library libclang and C++ API label May 19, 2025
@llvmbot llvmbot added the clang Clang issues not falling into any other category label May 19, 2025
@llvmbot
Copy link
Member

llvmbot commented May 19, 2025

@llvm/pr-subscribers-clang

Author: Vlad Serebrennikov (Endilll)

Changes

Now that we looked at this aspect closely and fixed things, I think we can document this.


Full diff: https://github.com/llvm/llvm-project/pull/140499.diff

1 Files Affected:

  • (modified) clang/bindings/python/clang/cindex.py (+2)
diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py
index f65bcad780a70..82a6197bf61af 100644
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -1585,6 +1585,8 @@ class Cursor(Structure):
     """
     The Cursor class represents a reference to an element within the AST. It
     acts as a kind of iterator.
+
+    Methods of this class return null cursors as None.
     """
 
     _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)]

@Endilll Endilll changed the title [libclang/python][NFC] Explain how null cursors are handled in docstring [libclang/python][NFC] Document how null cursors are handled May 19, 2025
@Endilll Endilll merged commit 8231182 into llvm:main May 19, 2025
13 checks passed
@Endilll Endilll deleted the null-cursors-docs branch May 19, 2025 08:30
ajaden-codes pushed a commit to Jaddyen/llvm-project that referenced this pull request Jun 6, 2025
…0499)

Now that we looked at this aspect closely and fixed things, I think we
can document this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:as-a-library libclang and C++ API clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants