P
Philippe Fremy
Hi,
I would like to develop a tool that goes one step further than pychecker
to ensure python program validity. The idea would be to get close to
what people get on ocaml: a static verification of all types of the
program, without any kind of variable declaration. This would definitely
brings a lot of power to python.
The idea is to analyse the whole program, identify constraints on
function arguments and check that these constraints are verified by
other parts of the program.
What is in your opinion the best tool to achieve this ? I had an
extensive look at pychecker, and it could certainly be extended to do
the job. Things that still concern me are that it works on the bytecode,
which prevents it from working with jython and the new .NET python.
I am currently reading the documentation on AST and visitor, but I am
not sure that this will be the best tool either. The AST seems quite
deep and I am afraid that it will make the analysis quite slow and
complicated.
For a simple pattern of what I want to do:
def f1( a ):
return a+1
def f2():
f1( [] )
Obviously, this won't work, but neither pychecker nor the python
interpreter will catch it. But a program analysis can catch it in this
simple example.
regards,
Philippe
I would like to develop a tool that goes one step further than pychecker
to ensure python program validity. The idea would be to get close to
what people get on ocaml: a static verification of all types of the
program, without any kind of variable declaration. This would definitely
brings a lot of power to python.
The idea is to analyse the whole program, identify constraints on
function arguments and check that these constraints are verified by
other parts of the program.
What is in your opinion the best tool to achieve this ? I had an
extensive look at pychecker, and it could certainly be extended to do
the job. Things that still concern me are that it works on the bytecode,
which prevents it from working with jython and the new .NET python.
I am currently reading the documentation on AST and visitor, but I am
not sure that this will be the best tool either. The AST seems quite
deep and I am afraid that it will make the analysis quite slow and
complicated.
For a simple pattern of what I want to do:
def f1( a ):
return a+1
def f2():
f1( [] )
Obviously, this won't work, but neither pychecker nor the python
interpreter will catch it. But a program analysis can catch it in this
simple example.
regards,
Philippe