Terry J. Reedy <tjre...@udel.edu> added the comment:

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.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12207>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to