nkmk on Twitter: "#Python豆知識 Pythonのコード上での書き方で記述された文字列をリストや辞書に変換するには「ast. literal_eval()」を使う。 文字列をPythonのリテラルとして評価するので、数値やブール値などを表現する文字列をそのままその型の値に変換してくれる ...
Python中eval与ast.literal_eval区别_杰瑞26的博客-CSDN博客
python函数eval与ast.literal_eval的区别- Python社区
python - why ast.literal_eval('1+1') is wrong in python2.7 - Stack Overflow
python - Alternative to ast.literal_eval? - Stack Overflow
PyBites - #Python trick we learned this week: if json.loads complains about invalid JSON, you can try to convert your string to a dict using ast. literal_eval: | Facebook
ast — Abstract Syntax Trees — Python 3.11.2 documentation