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 vstinner
Recipients benjamin.peterson, brett.cannon, georg.brandl, myronww, ncoghlan, r.david.murray, vstinner
Date 2015-12-16.22:25:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1450304754.3.0.760304370893.issue25885@psf.upfronthosting.co.za>
In-reply-to
Content
"There would be a huge benefit to having accurate original syntax information of the document and being able to re-write the documents as it would enable self modifying code or software written code paradigms."

You misunderstood the purpose of the AST tree. "Unparse" AST to retrieve the original source code is out of the scope of the Python AST structure and it's not going to happen. For that, you must use other tool. See for example RedBaron, as I said at:

http://bugs.python.org/issue25886#msg256543

Being able to "unparse" AST to regenerate the Python original source code requires complex operation. You have to store all formating information (spaces, new lines, etc.). You also have to store comments. It's just to give a few examples.

If AST contains formating information, it would be more complex to handle AST.
History
Date User Action Args
2015-12-16 22:25:54vstinnersetrecipients: + vstinner, brett.cannon, georg.brandl, ncoghlan, benjamin.peterson, r.david.murray, myronww
2015-12-16 22:25:54vstinnersetmessageid: <1450304754.3.0.760304370893.issue25885@psf.upfronthosting.co.za>
2015-12-16 22:25:54vstinnerlinkissue25885 messages
2015-12-16 22:25:53vstinnercreate