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 myronww
Recipients benjamin.peterson, brett.cannon, georg.brandl, myronww, ncoghlan, r.david.murray
Date 2015-12-16.22:16:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1450304194.49.0.146834645037.issue25885@psf.upfronthosting.co.za>
In-reply-to
Content
I am re-opening this as I believe this is an important issue for work I would like to eventually push into the python core which is python code that recode themselves as declarations or as instance representation.

"I don't see any benefit in supporting this even if we gain comment nodes in the AST."

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.

    TestCases that can update themselves in various modes, full auto, interactive, etc.

    TestData Pattern Generation object or Data Pattern Generation object that can be easily or efficiently modified and then asked to write themselves back out to files. 

The fact that there are other projects being worked on to provide round trip document to syntax tree and syntax tree to document transformations also indicates that the lack of accurate syntax storage in 'ast' is a problem that
needs to be addressed.

I would prefer to work with the core python modules in order to provide dynamic code modification functionality rather than relying on a third party module as eventually I would like to push this into core python.

If a python object has script behind it, I would like to eventually be able to tell a the object to write itself to a file as a object declaration or as a object instance.

As Declaration:

class SomeObject(SomeBase):
   def some method(self):
       print "blah blah"

As Instance:

   SomeObject()
History
Date User Action Args
2015-12-16 22:16:34myronwwsetrecipients: + myronww, brett.cannon, georg.brandl, ncoghlan, benjamin.peterson, r.david.murray
2015-12-16 22:16:34myronwwsetmessageid: <1450304194.49.0.146834645037.issue25885@psf.upfronthosting.co.za>
2015-12-16 22:16:34myronwwlinkissue25885 messages
2015-12-16 22:16:34myronwwcreate