eval('[1, 2, 3]')
from ast import literal_eval
literal_eval('[1, 2, 3]')
Used when you use the eval
function, to discourage its usage. Consider
using ast.literal_eval
for safely evaluating strings containing Python
expressions from untrusted sources.