Other side of Python eval() function
By Fahad Ahammed
- One minute read - 95 wordsThe built-in function “eval()” of python is useful in many cases. But I am gonna talk about it’s negative one.
Let, you have a function that take arguments from user. If you do eval() on that input, it might create a havoc.
As an example –
Running above code where last pin is a string which has function imported and ran a command. This can create a big problem.
This eval expression can really make your CPU hang in the tree. So, be aware to use eval without properly knowing what it might be evaluating.