更新时间:2022-06-01 01:37:11
也许您会在此食谱中找到一些启发:
Maybe you find some inspiration in this recipe:
输出人类的函数可读版本的Python AST。
A function that outputs a human-readable version of a Python AST.
或使用编译器
与检查
(当然,仍使用源代码):
Or use compiler
combined with inspect
(which, of course, still uses the source):
>>> import compiler, inspect
>>> import re # for testing
>>> compiler.parse(inspect.getsource(re))
Module('Support for regular expressions (RE). \n\nThis module provides ...