llvm-project
023a98c2 - [lldb] Add Pythonic API to SBStructuredData extension (#155061)

Commit
237 days ago
[lldb] Add Pythonic API to SBStructuredData extension (#155061) * Adds `dynamic` property to automatically convert `SBStructuredData` instances to the associated Python type (`str`, `int`, `float`, `bool`, `NoneType`, etc) * Implements `__getitem__` for Pythonic array and dictionary subscripting * Subscripting return the result of the `dynamic` property * Updates `__iter__` to support dictionary instances (supporting `for` loops) * Adds conversion to `str`, `int`, and `float` * Adds Pythonic `bool` conversion With these changes, these two expressions are equal: ```py data["name"] == data.GetValueForKey("name").GetStringValue(1024) ``` Additionally did some cleanup in TestStructuredDataAPI.py.
Author
Parents
Loading