[Python-ideas] parser in stdlib

Aaron Brady castironpi at comcast.net
Fri May 11 06:25:11 CEST 2007


> -----Original Message-----
> From: python-ideas-bounces at python.org [mailto:python-ideas-
> bounces at python.org] On Behalf Of Terry Reedy
> Sent: Thursday, May 10, 2007 11:02 PM
> 
> "Collin Winter" <collinw at gmail.com> | That is
> not and will not be possible using Python's built-in parser.
> 
> One can manipulate the AST that the parser produces.  (This is how the
> 2to3
> converter tool will work.)  Perhaps this will at least partially meet the
> OP's needs.  Beats head-butting a wall.
> 
> tjr

I've very much looked into it.  In fact, it gave rise to the follow-up idea
of attaching a `firstlineno' attribute to class objects.  (18:12 American
Central Time.)  Rather costly, 50% of the attributes, but stepping through
the InteractiveCodeGenerator class hasn't failed yet.




More information about the Python-ideas mailing list