[Lldb-commits] [PATCH] D84269: [lldb] Add some example type anotations to python.swig

Nathan Lanza via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 21 13:55:11 PDT 2020


lanza created this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Python3.5 (3.4?) added type annotations to the python language. This
lets tools such as LSPs provide useful IDE-like completion when writing
python.

Add type annotations throughout the python swig API would make writing
lldb python tooling much more approachable for users. This diff is a
first demonstration of the idea.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84269

Files:
  lldb/bindings/python.swig


Index: lldb/bindings/python.swig
===================================================================
--- lldb/bindings/python.swig
+++ lldb/bindings/python.swig
@@ -137,9 +137,9 @@
 debugger_unique_id = 0
 if _initialize:
    SBDebugger.Initialize()
-debugger = None
-target = None
-process = None
-thread = None
-frame = None
+debugger: lldb.SBDebugger = None
+target: lldb.SBTarget = None
+process: lldb.SBProcess = None
+thread: lldb.SBThread = None
+frame: lldb.SBFrame = None
 %}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84269.279629.patch
Type: text/x-patch
Size: 485 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200721/749a5f16/attachment.bin>


More information about the lldb-commits mailing list