I have a situation with some code where eval() came up as a possible solution. Now I have never had to use eval() before but, I have come across p
eval()
If all you need is a user provided dictionary, possible better solution is json.loads. The main limitation is that json dicts requires string keys. Also you can only provide literal data, but that is also the case for literal_eval.
json.loads
literal_eval