On Wed, 31 Dec 2008 03:08:29 -0200, Gabriel Genellina wrote: > eval is like Pandora´s box, all kind of bad things can come from it. Do > not use it with any user-supplied string. If you can restrict the values > to be just constants, there is a "safe eval" recipe in > http://code.activestate.com
The ast module in Python 2.6 includes a "literal eval" function: >>> ast.literal_eval("[1, 2, 3]") [1, 2, 3] -- Steven -- http://mail.python.org/mailman/listinfo/python-list