On Tue, Jan 8, 2013 at 1:21 PM, <andydtay...@gmail.com> wrote: > Repr and Eval I think I get. Eval certainly. That's a familiar concept, and > one I hope to use tomorrow to feed a line to psycopg2.
I hope not. Why do you need eval? It's extremely dangerous. Chances are there's a better way to do it; if your users are entering strings like "['Foo', 'Bar']" and you want them to be interpreted as lists, then you can get a much safer function ast.literal_eval - it's equivalent to eval, but (as the name suggests) works only with literals, so you can't call functions etc. But even that may be overkill, depending on what you actually need. ChrisA -- http://mail.python.org/mailman/listinfo/python-list