-
Notifications
You must be signed in to change notification settings - Fork 288
Closed
Labels
Description
I'm developing a static analysis for python code that depends on type information. I'd really like to use an existing type analysis instead of building my own! Is it possible to use pytype as a library?
The best case scenario for me would be to annotate every node of an AST with some kind of overapproximation of the type information (e.g. a list of possible types, a type with a hole in it, etc.). For example, I would like to write code like this:
my_ast = ast.parse(some_python_code)
typed_ast = pytype.analyze(my_ast)
...
class MyVisitor(ast.NodeVisitor):
def generic_visit(self,node):
print("This node has type " + str(node.type))
Is something like this possible?
KevinHock and akvadrako