[clang] Fix all mypy --strict errors in clang python binding (PR #101784)

2024-08-03 Thread via cfe-commits
TsXor wrote: @DeinAlptraum @Endilll I made this change mostly as a proof of concept: most type checking errors here originates from type information of C library functions invisible in type checker's eye. To really fix all type checking errors in a sane way instead of just putting a `#type: i

[clang] Fix all mypy --strict errors in clang python binding (PR #101784)

2024-08-03 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Thank you for your contribution! This is somewhat tricky situation, now that we have multiple opened PR in the same area of the codebase. But I think there is way forward: 1. https://github.com/llvm/llvm-project/pull/78114 and related work has been underway for several weeks, a

[clang] Fix all mypy --strict errors in clang python binding (PR #101784)

2024-08-03 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 98e4413a38f286147b863a6ead9625228ab0ec7d...c3ebad6a3447101cb307d5ca118d28d1b78b4dbe clang

[clang] Fix all mypy --strict errors in clang python binding (PR #101784)

2024-08-03 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @TsXor thank you for your work! I am generally all in favor of typing annotations, and I like that `ctyped` adds a stronger connection between the Python function definitions and the C library functions in terms of types. That said, this PR is pretty massive and grows the P

[clang] Fix all mypy --strict errors in clang python binding (PR #101784)

2024-08-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (TsXor) Changes Related: https://github.com/llvm/llvm-project/issues/76664 I used metadata reflection so that we can import C library functions just by declaring annotated python functions. This makes C function types visible to typ

[clang] Fix all mypy --strict errors in clang python binding (PR #101784)

2024-08-02 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it