How to correctly return a list of class instances in Python
class, list, python
Solution
You are looking at the `repr()` representation output of your classes. `repr()` will call the `__repr__()` hook if defined on your custom classes:
def __repr__(self):
return '<linge1Stop: name={0}>'.format(self.name)
Problem
``` class ligne(): def __init__ (self, stops): ##stops = a list of instances of Ligne1Stop class self.stops = stops def returnAllStopsOnLigne(self): return self.stops ``` When I call the method returnAllStopsOnLigne() I get a list of ``` "<__main__.ligne1Stop instance at 0x1418828"> ``` How can I return the proper class instance names in my stops list?