llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Jannick Kremer (DeinAlptraum)

<details>
<summary>Changes</summary>

As discussed in 
https://github.com/llvm/llvm-project/pull/180876#discussion_r2934372753, 
`Type.get_offset` can process `bytes` arguments as well. For consistency with 
other functions taking `str` arguments, its type annotation is adapted to 
reflect this.

---
Full diff: https://github.com/llvm/llvm-project/pull/187841.diff


1 Files Affected:

- (modified) clang/bindings/python/clang/cindex.py (+1-1) 


``````````diff
diff --git a/clang/bindings/python/clang/cindex.py 
b/clang/bindings/python/clang/cindex.py
index c34a1c0db01e9..57e1855886b8b 100644
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -2919,7 +2919,7 @@ def get_size(self) -> int:
         """
         return conf.lib.clang_Type_getSizeOf(self)  # type: ignore 
[no-any-return]
 
-    def get_offset(self, fieldname: str) -> int:
+    def get_offset(self, fieldname: TUnion[str, bytes]) -> int:
         """
         Retrieve the offset of a field in the record.
         """

``````````

</details>


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

Reply via email to