[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > Which parts do you mean? The `__eq__` operators for other objects? Yes, and `briefComment` function, too. https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-05-01 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: Which parts do you mean? The `__eq__` operators for other objects? https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I totally forgot about release notes and tests. While release notes may not be necessary, I think we should test those new checks that you added. https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-05-01 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-aarch64-darwin` running on `doug-worker-4` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/19308 Here is th

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-05-01 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-05-01 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll thank you for the review, I've implemented your suggestions https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-05-01 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/138074 >From 4c90f65045c1fdabc1f91c746b1ecae04e14dd4e Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 1 May 2025 10:42:33 +0900 Subject: [PATCH 1/2] [libclang/python] Add some logical typing changes. ---

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread Vlad Serebrennikov via cfe-commits
@@ -3466,6 +3479,8 @@ def get_tokens(self, locations=None, extent=None): """ if locations is not None: extent = SourceRange(start=locations[0], end=locations[1]) +if extent is None: +raise TypeError("get_tokens() requires at least

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread Vlad Serebrennikov via cfe-commits
@@ -2955,6 +2962,10 @@ def __getitem__(self, key): raise IndexError return CompletionChunk(self.obj, key) +def __iter__(self): +for i in range(len(self)): +yield self[i] + Endilll wrote: Can we put this under `if TY

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread Vlad Serebrennikov via cfe-commits
@@ -2888,8 +2896,7 @@ def string(self): if res: return CompletionString(res) -else: -None +return None Endilll wrote: Can you invert this if statement, so that we do early exit on unhappy code paths? https://g

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Thank you for working on this! Looks good overall. I left some comments https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread Jannick Kremer via cfe-commits
@@ -3466,6 +3479,8 @@ def get_tokens(self, locations=None, extent=None): """ if locations is not None: extent = SourceRange(start=locations[0], end=locations[1]) +if extent is None: +raise TypeError("get_tokens() requires at least

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread Jannick Kremer via cfe-commits
@@ -314,6 +316,8 @@ def is_in_system_header(self): return conf.lib.clang_Location_isInSystemHeader(self) # type: ignore [no-any-return] def __eq__(self, other): +if not isinstance(other, SourceLocation): +return False DeinAlpt

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum deleted https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jannick Kremer (DeinAlptraum) Changes This adds a few logical changes that might require some discussion to the libclang/python typing project, as the next step towards #76664 --- Full diff: https://github.com/llvm/llvm-project/pull/1380

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-04-30 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/138074 This adds a few logical changes that might require some discussion to the libclang/python typing project, as the next step towards #76664 >From 4c90f65045c1fdabc1f91c746b1ecae04e14dd4e Mon Sep 17 00:00:00