[clang] [libclang/python] Add strict typing to clang Python bindings (#76664) (PR #78114)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 31 05:20:12 PDT 2024


================
@@ -3257,21 +3323,21 @@ def reparse(self, unsaved_files=None, options=0):
         if unsaved_files is None:
             unsaved_files = []
 
-        unsaved_files_array = 0
+        unsaved_files_array: int | Array[_CXUnsavedFile] = 0
         if len(unsaved_files):
             unsaved_files_array = (_CXUnsavedFile * len(unsaved_files))()
             for i, (name, contents) in enumerate(unsaved_files):
                 if hasattr(contents, "read"):
                     contents = contents.read()
-                contents = b(contents)
+                binary_contents = b(contents)
----------------
Endilll wrote:

I merged #101308 just now, so you can sidestep the issue by updating this PR with changes from `main`.

https://github.com/llvm/llvm-project/pull/78114


More information about the cfe-commits mailing list