4 ms·
I guess you could build an AST from the Python code and eval if it's successful. No gaurentee the code will run, of course (you could always get an error). In
by narush 3y ago
I guess you could build an AST from the Python code and eval if it's successful. No gaurentee the code will run, of course (you could always get an error).
In general, it feels it's halting problem hard to determine if any general purpose programming language program is executable or safe... but maybe if we reduce the size of the spec under consideration?