Question about ast.literal_eval

Chris Angelico rosuav at gmail.com
Mon May 20 12:23:19 EDT 2013


On Tue, May 21, 2013 at 2:12 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Personally, I would strongly suggest writing your own mini-
> evaluator that walks the list and evaluates it by hand. It isn't as
> convenient as just calling eval, but *definitely* safer.

Probably faster, too, for what it's worth - eval is pretty expensive.

ChrisA



More information about the Python-list mailing list