Re: [Tutor] Storing information as attributes or in a dictionary

2012-09-18 Thread Steven D'Aprano
On Tue, Sep 18, 2012 at 07:14:26AM -0700, Michiel de Hoon wrote: > Dear all, > > Suppose I have a parser that parses information stored in e.g. an XML file. You mean like the XML parsers that already come with Python? http://docs.python.org/library/markup.html http://eli.thegreenplace.net/2012/0

Re: [Tutor] Storing information as attributes or in a dictionary

2012-09-18 Thread Oscar Benjamin
On 18 September 2012 15:14, Michiel de Hoon wrote: > Dear all, > > Suppose I have a parser that parses information stored in e.g. an XML > file. I would like to design a Python class to store the information > contained in this XML file. > > One option is to create a class like this: > > class Re

[Tutor] Storing information as attributes or in a dictionary

2012-09-18 Thread Michiel de Hoon
Dear all, Suppose I have a parser that parses information stored in e.g. an XML file. I would like to design a Python class to store the information contained in this XML file. One option is to create a class like this: class Record(object): pass and store the information in the XML file