Author: Thomas Applencourt
Date: 2026-03-27T07:47:00+04:00
New Revision: add5b811ae51d2f155b99af82db48a61e4fd76ef

URL: 
https://github.com/llvm/llvm-project/commit/add5b811ae51d2f155b99af82db48a61e4fd76ef
DIFF: 
https://github.com/llvm/llvm-project/commit/add5b811ae51d2f155b99af82db48a61e4fd76ef.diff

LOG: [libclang/python] Renaming `get_version` into `get_clang_version`  
(#188515)

Rename `get_version` to `get_clang_version` to match the `libclang.so`
name[1], and be clear we doesn't return some `cindex.py` internal
versioning but the `libclang.so` one.

[1] This match was some current API are doing for example
`conf.lib.clang_getArraySize` is mapped to `get_array_size`.

Added: 
    

Modified: 
    clang/bindings/python/clang/cindex.py
    clang/bindings/python/tests/cindex/test_version.py
    clang/docs/ReleaseNotes.rst

Removed: 
    


################################################################################
diff  --git a/clang/bindings/python/clang/cindex.py 
b/clang/bindings/python/clang/cindex.py
index 6e8ea782df74c..b71f9ed2275e0 100644
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -4650,7 +4650,7 @@ def get_cindex_library(self) -> CDLL:
 
         return library
 
-    def get_version(self):
+    def get_clang_version(self) -> str:
         """
         Returns the libclang version string used by the bindings
         """

diff  --git a/clang/bindings/python/tests/cindex/test_version.py 
b/clang/bindings/python/tests/cindex/test_version.py
index 0540185221daa..2b25b0bd1c526 100755
--- a/clang/bindings/python/tests/cindex/test_version.py
+++ b/clang/bindings/python/tests/cindex/test_version.py
@@ -6,6 +6,6 @@
 class TestClangVersion(unittest.TestCase):
     def test_get_version_format(self):
         conf = Config()
-        version = conf.get_version()
+        version = conf.get_clang_version()
 
         self.assertRegex(version, r"^clang version \d+\.\d+\.\d+")

diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 1ab3aae640607..80913393e69c5 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -580,8 +580,8 @@ Python Binding Changes
   ``CodeCompletionResults.results`` should be changed to directly use
   ``CodeCompletionResults``: it nows supports ``__len__`` and ``__getitem__``,
   so it can be used the same as ``CodeCompletionResults.results``.
-- Added a new helper method ``get_version`` to the class ``Config`` to read the
-  version string of the libclang in use.
+- Added a new helper method ``get_clang_version`` to the class ``Config`` to
+  read the version string of the libclang in use.
 
 OpenMP Support
 --------------


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to