Ok so basically what I’m reading data from a file and with that data I want to create an object for each line.
So something like:
bar = [['a','b'],['c','d']]
for foo in bar:
foo = Class_name(list_of_arguments)
What would be the best technique to ‘unpack’ the list? Would this best be done in the initializer method of the class or would it be better to do this before the creating the object and pass the arguments in a non-list format? I ask because the lists contains information relating to the object which will be used by the class.
Also I would like each object to have a unique name, What should I do for that? Would it best be use to one of the values in the list?
I … think I understand your question. I’d probably approach it like so:
That should instantiate myClass for each set of values and return a list of the new objects, accessible by index.