This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients benjamin.peterson, docs@python, eric.araujo, terry.reedy
Date 2011-06-03.21:30:23
SpamBayes Score 5.5290217e-12
Marked as misclassified No
Message-id <1307136624.92.0.714910735079.issue12207@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-06-03 21:30:24terry.reedysetrecipients: + terry.reedy, benjamin.peterson, eric.araujo, docs@python
2011-06-03 21:30:24terry.reedysetmessageid: <1307136624.92.0.714910735079.issue12207@psf.upfronthosting.co.za>
2011-06-03 21:30:24terry.reedylinkissue12207 messages
2011-06-03 21:30:23terry.reedycreate