[clang] [libclang/python] Add type annotations to the TranslationUnit class (PR #180876)
Jannick Kremer via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 18 06:07:35 PST 2026
================
@@ -3490,11 +3504,12 @@ def from_source(
etc. e.g. ["-Wall", "-I/path/to/include"].
In-memory file content can be provided via unsaved_files. This is a
- list of 2-tuples. The first element is the filename (str or
+ list of 2-tuples. The first element is the filename (str, bytes or
PathLike). The second element defines the content. Content can be
- provided as str source code or as file objects (anything with a read()
- method). If a file object is being used, content will be read until EOF
- and the read cursor will not be reset to its original position.
+ provided as str or bytes source code, or as file objects (anything with
+ a read() method). If a file object is being used, content will be read
+ until EOF and the read cursor will not be reset to its original
+ position.
----------------
DeinAlptraum wrote:
How exactly do you mean "everywhere"?
We could generally always pass string arguments through `b()`. That would affect quite a few places, but it would be trivial to do.
https://github.com/llvm/llvm-project/pull/180876
More information about the cfe-commits
mailing list