[python] Convert string to Python class object?