Message137590
This is a bit tricky. It may be superseded, but it is still there, is possible used in older code, has not been deprecated as far as I know, and appears in dir(ast).
The two current mentions of PyCF_ONLY_AST in ast doc are:
"An abstract syntax tree can be generated by passing ast.PyCF_ONLY_AST as a flag to the compile() built-in function, or using the parse() helper provided in this module." (near the top )
"ast.parse(source, filename='<unknown>', mode='exec')
Parse the source into an AST node. Equivalent to compile(source, filename, mode, ast.PyCF_ONLY_AST)."
The first mention is referred to in the compile entry:
"compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1)
Compile the source into a code or AST object. Code objects can be executed by exec() or eval(). source can either be a string or an AST object. Refer to the ast module documentation for information on how to work with AST objects."
In my view, it is adequately documented now, should not be undocumented, and should not be given more prominence either. So I recommend closing this.
Hmm. It should be indexed for anyone reading existing code. If possible, I would have the index point to the first current sentence, which also mentions .parse() as an alternative. |
|
Date |
User |
Action |
Args |
2011-06-03 21:30:24 | terry.reedy | set | recipients:
+ terry.reedy, benjamin.peterson, eric.araujo, docs@python |
2011-06-03 21:30:24 | terry.reedy | set | messageid: <1307136624.92.0.714910735079.issue12207@psf.upfronthosting.co.za> |
2011-06-03 21:30:24 | terry.reedy | link | issue12207 messages |
2011-06-03 21:30:23 | terry.reedy | create | |
|