python 2.5 and ast

A

Andrea Crotti

I'm happily using the ast module to analyze some code,
but my scripts need also to run unfortunately on python 2.5

The _ast was there already, but the ast helpers not yet.
Is it ok if I just copy over the source from the ast helpers in my code base
or is there a smarter way?
(I don't even need all of them, just "parse" and NodeVisitor at the moment)
 
8

88888 Dihedral

I'm happily using the ast module to analyze some code,
but my scripts need also to run unfortunately on python 2.5

The _ast was there already, but the ast helpers not yet.
Is it ok if I just copy over the source from the ast helpers in my code base
or is there a smarter way?
(I don't even need all of them, just "parse" and NodeVisitor at the moment)

Sounds like a hash for nodes and a hash for a tree.
A hash can replace a tree of finite number of nodes.
An array or list is enough to replace a tree of finite number of nodes.

The heap sort ordering is simple but illustrative .

After all the tasks of the tree are done, the hash of the tree
will be deleted by Python's garbage collection mechanism.

A hash can replace an indexed array with (k,v) pairs for k=0,1,2,3...n in
a trivial way.
 
8

88888 Dihedral

I'm happily using the ast module to analyze some code,
but my scripts need also to run unfortunately on python 2.5

The _ast was there already, but the ast helpers not yet.
Is it ok if I just copy over the source from the ast helpers in my code base
or is there a smarter way?
(I don't even need all of them, just "parse" and NodeVisitor at the moment)

Sounds like a hash for nodes and a hash for a tree.
A hash can replace a tree of finite number of nodes.
An array or list is enough to replace a tree of finite number of nodes.

The heap sort ordering is simple but illustrative .

After all the tasks of the tree are done, the hash of the tree
will be deleted by Python's garbage collection mechanism.

A hash can replace an indexed array with (k,v) pairs for k=0,1,2,3...n in
a trivial way.
 
I

Ian Kelly

Sounds like a hash for nodes and a hash for a tree.
A hash can replace a tree of finite number of nodes.
An array or list is enough to replace a tree of finite number of nodes.

The heap sort ordering is simple but illustrative .

After all the tasks  of the tree are done, the hash of the tree
will be deleted by Python's garbage collection mechanism.

A hash can replace an indexed array with (k,v) pairs for k=0,1,2,3...n in
a trivial way.

What in the world does any of this have to do with using the ast
module in Python 2.5? I am starting to suspect that "88888 Dihedral"
may be a bot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top