[clang] [libclang/python] Add strict typing to clang Python bindings (#76664) (PR #78114)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 30 16:57:47 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:
This is not related to strict typing, and should also be factored out. Also, why is this code repeated 70 lines below? Should we move it out into a function?
https://github.com/llvm/llvm-project/pull/78114
More information about the cfe-commits
mailing list