Reputation:
I am trying to port a codebase which uses the "compiler" module from 2.x over to 3.1 ; I get an ImportError at
import compiler
as the module does not exist in Python3.x ; Has the same functionality been integrated into another module within the standard library? Or has it been completely removed?
[EDIT]
I require an equivalent for compiler.parse.getChildren
in Py3k.
Upvotes: 8
Views: 1732
Reputation: 70984
It depends on what you want to do. The abstract syntax tree stuff has largely been moved into the ast
module.
Apparently the compile built in function can compile an AST object to bytecode which (coarsely) handles the remaining functionality of the compiler
module. I've also never done this so YMMV.
Upvotes: 5
Reputation: 336078
According to the docs, the module has been deprecated since 2.6 and been completely removed in 3.0.
From PEP 3108:
Upvotes: 7