+ 2
When i run the viewinfo() function, i dont get the real information printed out, any idea how to fix it?
I know its a list of objects but how do i get the real content printed out? https://code.sololearn.com/c85wUDDd7OR1/?ref=app
1 Answer
0
A search about this always brings up repr():
def __repr__(self):
return somefunction(self)
repr(instance)
and using self I think implies the attribute hsving already been initialized by the __init__(self) constructor, and that I think requires that you change some of your code, maybe gathering the listing of all other info but from the lists class that a new allinfo class would inherit, I dunno, so instead of appending each to allinfo you just create an instsnce of all info witj all the others as attributes from the inherited class... I'm kind of stalking this to see the responses.
This is a nice question to learn more about how classes work.