I was writing custom template tags for one of my Django package. I came across a situation where I had lists in string format. I need to convert them into lists.
There are two methods to get this job done.
This can be used to evaluate strings containing Python values from untrusted sources without parsing values.
These two functions come in handy whenever you want to convert a list of python objects to their correct types. For example, if you have list of python objects like this
You can convert them to their corresponding types using these functions.
They yield a objects of corresponding types
References: Python Docs