How to do a Lispy-esque read?

Arnaud Delobelle arnodel at gmail.com
Mon Apr 8 13:46:22 EDT 2013


On 8 April 2013 08:45,  <zeta.convex at gmail.com> wrote:
> Suppose I want to read an object from some stream. How do I do it?
>
> For example, if the input stream contained the text:
> [1, # python should ignore this comment
> 2]
>
> and I do a "read" on it, I should obtain the result
> [1, 2]

You might be interested in code.compile_command()
(http://docs.python.org/2/library/code.html)

-- 
Arnaud



More information about the Python-list mailing list