================
@@ -3835,23 +3863,23 @@ class CompileCommands:
     that can be used for building a specific file.
     """
 
-    def __init__(self, ccmds):
-        self.ccmds = ccmds
+    def __init__(self, ccmds: CObjP) -> None:
+        self.ccmds: CObjP = ccmds
 
-    def __del__(self):
+    def __del__(self) -> None:
         conf.lib.clang_CompileCommands_dispose(self.ccmds)
 
-    def __len__(self):
+    def __len__(self) -> int:
         return int(conf.lib.clang_CompileCommands_getSize(self.ccmds))
 
-    def __getitem__(self, i):
+    def __getitem__(self, i: int) -> CompileCommand:
         cc = conf.lib.clang_CompileCommands_getCommand(self.ccmds, i)
         if not cc:
             raise IndexError
         return CompileCommand(cc, self)
 
     @staticmethod
-    def from_result(res):
+    def from_result(res: Any) -> CompileCommands | None:
----------------
Endilll wrote:

`res` has to be convertible to `bool` and be something that 
`CompileCommands.__init__` can work with, which is not `Any`.

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

Reply via email to