[Python-ideas] Could the ast module's ASTs preserve source_length in addition to lineno and col_offset?

Nick Coghlan ncoghlan at gmail.com
Fri May 31 07:04:13 CEST 2013


On 31 May 2013 14:28, "Haoyi Li" <haoyi.sg at gmail.com> wrote:
>
> Anyone else have any thoughts about this? This seems like it would be a
pretty straightforward thing to do, and I would be happy to go through the
code and submit a patch. The only question is whether we want to do it in
the first place; are there any reasons it can't/shouldn't be done that I'm
not aware of?

Seems reasonable to me, but would need to see a patch to give a definite
yes or no.

Cheers,
Nick.

>
>
> On Wed, May 29, 2013 at 8:09 PM, Steven D'Aprano <steve at pearwood.info>
wrote:
>>
>> On 30/05/13 10:04, Haoyi Li wrote:
>>>
>>> I don't need to keep the source code, I just need a single integer for
each
>>> node. I would then be able to reconstruct the source snippet.
>>
>>
>> And so you did say. Sorry for the noise.
>>
>>
>> --
>> Steven
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> http://mail.python.org/mailman/listinfo/python-ideas
>
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130531/d88dbfa5/attachment.html>


More information about the Python-ideas mailing list