I am currently working on building a piece of code that is composing business objects from tuples that it has been given by the data source I am using. Since these tuples may vary in length and their naming, I want to insert a pre-defined tuple into the for loop.
class_attributes = ("_id", "_first_name", "_last_name")
for class_attributes in answer:
# I would want to access them dynamically in here, instead Python is using "class_attributes" as a local variable inside the for loop
The piece of code from above usually fetches the tuple dynamically, resulting in different arguments and lengths of the tuple, therefore copying the line of code into the for loop is not feasible.