On 11/30/2011 5:48 PM, Hidura wrote:
Why you don't make this "['1','2','3']".strip("[]").split(',') work for me

Look more carefully. This is not the same as ast.literal_eval().

>>> "['1','2','3']".strip("[]").split(',')
["'1'", "'2'", "'3'"]  # list of 3-char strings
>>> ast.literal_eval("['1','2','3']")
['1', '2', '3']  # list of 1-char strings

Even if it were the same, it would be specific to lists of strings and would not work for anything else.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to