Yury Selivanov added the comment: > ast.Constant is *not* emited by the compiler to not break backward compatibility. I *know* that there is no stable API on AST, but I noticed some issues when working on my AST project. For example, pip doesn't work because an internal library uses AST and the code doesn't handle ast.Constant (it's probably super easy to fix it).
Yeah, it's probably very easy to fix. And if pip stops working on 3.6-alpha it will be fixed. We don't give any guarantees on AST backwards compatibility. In fact, we even tell that the AST might change in every release in the docs "The abstract syntax itself might change with each Python release". > I'm open to change the compiler to emit ast.Constant directly, but maybe only in "optimized mode" (ex: python -O?). I'm -1 on using -O flag since some people would prefer to have optimizations *and* have their assert statements. In fact I'm -1 on using any kind of flag to trigger optimizations on or off. Those flags will only drive confusion. If the optimizations are any good, people will simply start using the flag all the time. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26297> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com