[lldb][Python] Inline `lldb_iter` for better type inference (#214000)
Currently, the `lldb_iter` helper is used for providing `__iter__` in
the Python bindings:
```python
def lldb_iter(obj, getsize, getelem):
"""A generator adaptor to support iteration for lldb container objects."""
size = getattr(obj, getsize)
elem = getattr(obj, getelem)
for i in range(size()):
yield elem(i)
```
A type checker or LSP can't see through this function. Currently, that's
no problem, because it doesn't know the return type of any Swig wrapper,
but when we add type annotations (hopefully with Swig 4.5 in #213463),
`__iter__` remains untyped. So iterating through the wrappers won't show
the correct type.
As the functionality is fairly simple, it's easier to inline it. That's
what this PR does. Then a type checker can infer the return type.
GitOrigin-RevId: 08a8739ac89a27c7dbd0349266611ca94866ae2f
25 files changed