Fixed sorted list in python_eval function