[Lldb-commits] [PATCH] D120292: [lldb] Add lldb.find helper function

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 22 10:33:33 PST 2022


mib added inline comments.


================
Comment at: lldb/bindings/python/python-extensions.swig:528-533
+def find(pattern, flags=re.I):
+    """
+    Find matching SB methods/properties. See also Python's builtin `help()`.
+    """
+    import lldb
+    import re
----------------
kastiglione wrote:
> oh, I need to figure out the right way to manage imports in this swig extension. It seems that the `re` module is used (as a default argument) before importing it, and yet this code works.
Can't you just import it after the `%pythoncode %{` statement instead of doing it in the function ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120292/new/

https://reviews.llvm.org/D120292



More information about the lldb-commits mailing list