Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #16319 > unrolled thread

python 2.5 and ast

Started byAndrea Crotti <andrea.crotti.0@gmail.com>
First post2011-11-28 11:45 +0000
Last post2011-12-02 10:28 -0800
Articles 4 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  python 2.5 and ast Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-11-28 11:45 +0000
    Re: python 2.5 and ast 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-02 10:28 -0800
      Re: python 2.5 and ast Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-02 11:43 -0700
    Re: python 2.5 and ast 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-02 10:28 -0800

#16319 — python 2.5 and ast

FromAndrea Crotti <andrea.crotti.0@gmail.com>
Date2011-11-28 11:45 +0000
Subjectpython 2.5 and ast
Message-ID<mailman.3088.1322480760.27778.python-list@python.org>
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)

[toc] | [next] | [standalone]


#16562

From88888 Dihedral <dihedral88888@googlemail.com>
Date2011-12-02 10:28 -0800
Message-ID<6866657.516.1322850490609.JavaMail.geo-discussion-forums@prjr26>
In reply to#16319
On Monday, November 28, 2011 7:45:57 PM UTC+8, Andrea Crotti wrote:
> 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.

[toc] | [prev] | [next] | [standalone]


#16567

FromIan Kelly <ian.g.kelly@gmail.com>
Date2011-12-02 11:43 -0700
Message-ID<mailman.3236.1322851469.27778.python-list@python.org>
In reply to#16562
On Fri, Dec 2, 2011 at 11:28 AM, 88888 Dihedral
<dihedral88888@googlemail.com> wrote:
> On Monday, November 28, 2011 7:45:57 PM UTC+8, Andrea Crotti wrote:
>> 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.

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.

[toc] | [prev] | [next] | [standalone]


#16563

From88888 Dihedral <dihedral88888@googlemail.com>
Date2011-12-02 10:28 -0800
Message-ID<mailman.3233.1322850499.27778.python-list@python.org>
In reply to#16319
On Monday, November 28, 2011 7:45:57 PM UTC+8, Andrea Crotti wrote:
> 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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web