我正在玩dis
库来收集有关函数的信息(就像它调用的其他函数一样)。 dis.findlabels
的文档听起来像它会返回其他函数调用,但我已经尝试了一些函数,它总是返回一个空列表。dis.findlabels()是做什么的?
dis.findlabels(code) Detect all offsets in the code object code which are jump targets, and return a list of these offsets.
这是什么功能应该做,如何你会用吗?
使用'dis.findlabels(f .__ code __。co_code)'并确保f中有一个跳转目标(例如, for循环中的条件break语句) – wim