Need help understanding list structure

moa47401 at gmail.com moa47401 at gmail.com
Tue May 3 13:31:10 EDT 2016


I added a __repr__ method at the end of the gedcom library like so:

def __repr__(self):
        """ Format this element as its original string """
        result = repr(self.level())
        if self.pointer() != "":
            result += ' ' + self.pointer()
        result += ' ' + self.tag()
        if self.value() != "":
            result += ' ' + self.value()
        return result

and now I can print myList properly.

Eric and Michael also mentioned repr above, but I guess I needed someone to spell it out for me. Thanks for taking the time to put it in terms an old dog could understand.





More information about the Python-list mailing list