Brett Cannon added the comment: You can verify a script is syntactically correct by compiling it to an AST or just calling compile() which is another way of doing essentially what `import` does but without having to worry about import-related side-effects in the code being checked.
But is this really worth adding to the stdlib? You can run your tests to verify the code is syntactically sound, run pylint, etc. I think this is probably straying a bit too much into the tooling arena to make the maintenance burden worth having in the stdlib. ---------- nosy: +brett.cannon _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25303> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com