Suppose I have the following codes:
lens_A = Lens(...) # declare an object of type 'Lens' called 'lens_A' table = Bench() # declare an object 'Bench' called 'table' table.addcomponent(lens_A, 10) addcomponent(self, component, position): # a method inside the class Bench self.__component_class.append(component) self.__component_position.append(position) self.__component_name.append(...) # how to do this???? I want to write the last line such that I can add the name of the class variable ('lensA') to the list self.__component_name, but not the location of the instance (which is done in self.__component_class). How to do that?
Lensclass and refer to that.table.addcomponent(Lens(...), 10)?lens_A = lens_B = Lens(), which name is right.