Myron Walker added the comment:
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()
----------
status: closed -> open
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25885>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com