瀏覽代碼

Add type annotations for VTableFunction

nosoop 11 月之前
父節點
當前提交
11597cd501
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/smgdc/vtable.py

+ 3 - 1
src/smgdc/vtable.py

@@ -92,7 +92,9 @@ def get_vtables_from_address(bin: "LinuxBinary", vt: Symbol) -> list[VTable]:
     vtda = bin.vtable_disambiguator
 
     # returns a list of vtables for each vtable present on the class
-    VTableFunction = collections.namedtuple("VTableFunction", "tblidx sym")
+    class VTableFunction(typing.NamedTuple):
+        tblidx: int
+        sym: Symbol
 
     table_index = 0
     function_list: list[VTableFunction] = []