Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
Compilation includes the following stages: 1. Tokenizing. 2. Creating CST (concrete syntax tree). 3. Creating AST (abstract syntax tree). 4. Optimizing AST. 5. Building symtable. 6. Generating bytecode. 7. Optimizing bytecode. ast.parse() only includes stages 1-3. Many warnings and errors can be raised at stages 5 and 6 (for example errors for "break" outside of a loop and "unlocal" at module level). If you want to get all warnings and errors, use compile(). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40378> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com