<p dir="ltr"><br>
On Aug 13, 2012 5:22 PM, "<a href="mailto:fwierzbicki@gmail.com">fwierzbicki@gmail.com</a>" <<a href="mailto:fwierzbicki@gmail.com">fwierzbicki@gmail.com</a>> wrote:<br>
><br>
> On Mon, Aug 13, 2012 at 1:46 PM, Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br>
> > On Mon, Aug 13, 2012 at 1:05 PM, <a href="mailto:fwierzbicki@gmail.com">fwierzbicki@gmail.com</a><br>
> > <<a href="mailto:fwierzbicki@gmail.com">fwierzbicki@gmail.com</a>> wrote:<br>
> >> On Mon, Aug 13, 2012 at 12:06 PM, Brett Cannon <<a href="mailto:brett@python.org">brett@python.org</a>> wrote:<br>
> >>>> I see nothing about ast possibly being CPython only. Should there be?<br>
> >>><br>
> >>><br>
> >>> Time to ask the other VMs what they are currently doing (the ast module came<br>
> >>> into existence in Python 2.6 so all the VMs should be answer the question<br>
> >>> since Jython is in alpha for 2.7 compatibility).<br>
> ><br>
> > [Jython]<br>
> >> 2.5+ contains an ast.py that I obsessively compared to CPython's 2.5<br>
> >> ast.py.<br>
> ><br>
> > But CPython's ast.py contains very little code -- it's all done in ast.c.<br>
> What I did was dump a pretty print of the ast from Jython and CPython<br>
> for every file in Lib/* and diff the results with a script. I got the<br>
> differences down to a small number of minor variations.<br>
><br>
> > Still, I'm glad you are actually considering this a cross-language<br>
> > feature, and I will gladly retract my warning. (Still, I don't know if<br>
> > it is subject to the usual backward compatibility constraints.)<br>
> I don't know if IronPython does the same though... we might want to<br>
> wait for them to respond.<br>
><br>
> > It might be pure python for Jython, but it's not for CPython.<br>
> It's actually Java for us :) -- in fact the internal AST uses the<br>
> exact Java that is exposed from our _ast.py - which I've come to<br>
> regard as a mistake (though it was useful at the time). I want to do<br>
> the same obsessive diff game with 3.x but then probably separate out<br>
> our internal ast implementation (possibly making ast.py pure Python).<br>
><br>
> BTW - is Python's internal AST exactly exposed by ast.py or is there a<br>
> separate internal AST implementation?</p>
<p dir="ltr">Direct. There is an AST grammar file that gets compiled into C and Python objects which are used by the compiler (c version) or exposed to users (Python version).</p>
<p dir="ltr">><br>
> -Frank<br>
</p>