[clang] [libclang/python] Fix some type errors, add type annotations (PR #98745)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 13 06:21:30 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r 1bad7024561bc64ed4bfda0772b16376b475eba5...06483bd3e398dd9dba757904e622d5dd1b37db77 clang/bindings/python/clang/cindex.py clang/bindings/python/tests/cindex/test_code_completion.py clang/bindings/python/tests/cindex/test_comment.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- clang/cindex.py	2024-07-13 13:12:34.000000 +0000
+++ clang/cindex.py	2024-07-13 13:21:02.416533 +0000
@@ -93,12 +93,15 @@
     CObjP: TypeAlias = _Pointer[Any]
 
     TSeq = TypeVar("TSeq", covariant=True)
 
     class NoSliceSequence(Protocol[TSeq]):
-        def __len__(self) -> int: ...
-        def __getitem__(self, key: int) -> TSeq: ...
+        def __len__(self) -> int:
+            ...
+
+        def __getitem__(self, key: int) -> TSeq:
+            ...
 
 
 # Python 3 strings are unicode, translate them to/from utf8 for C-interop.
 class c_interop_string(c_char_p):
     def __init__(self, p: str | bytes | None = None):

``````````

</details>


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


More information about the cfe-commits mailing list