Re: [Tutor] Keeping a list of attributes of a certain type

2010-01-15 Thread Kent Johnson
On Fri, Jan 15, 2010 at 3:43 PM, Guilherme P. de Freitas wrote: > Ok, I checked the answers you all gave me, and the suggestions seem to be 2: > > a. Compute the list of members on the fly, with a list comprehension > that looks up stuff on self.__dict___; > > b. Stay with my solution, but substit

Re: [Tutor] Keeping a list of attributes of a certain type

2010-01-15 Thread Guilherme P. de Freitas
Ok, I checked the answers you all gave me, and the suggestions seem to be 2: a. Compute the list of members on the fly, with a list comprehension that looks up stuff on self.__dict___; b. Stay with my solution, but substituting the unnecessary "if-else" by a simple "if". In sum, maintain a list o

Re: [Tutor] Keeping a list of attributes of a certain type

2010-01-15 Thread Guilherme P. de Freitas
Thanks everybody for all the suggestions and ideas. I still did not have time to look them all over, but I will. Thanks again! Best, Guilherme On Thu, Jan 14, 2010 at 4:52 AM, Alan Gauld wrote: > > "Guilherme P. de Freitas" wrote > >> Here is my problem. I have two classes, 'Body' and 'Member'

Re: [Tutor] Searching in a file

2010-01-15 Thread Dave Angel
Paul Melvin wrote: Hi, Thanks very much to all your suggestions, I am looking into the suggestions of Hugo and Alan. The file is not very big, only 700KB (~2 lines), which I think should be fine to be loaded into memory? I have two further questions though please, the lines are like this:

Re: [Tutor] Searching in a file

2010-01-15 Thread Kent Johnson
On Fri, Jan 15, 2010 at 4:24 AM, Paul Melvin wrote: > Hi, > > Thanks very much to all your suggestions, I am looking into the suggestions > of Hugo and Alan. > > The file is not very big, only 700KB (~2 lines), which I think should be > fine to be loaded into memory? > > I have two further que

[Tutor] Searching in a file

2010-01-15 Thread Paul Melvin
Hi, Thanks very much to all your suggestions, I am looking into the suggestions of Hugo and Alan. The file is not very big, only 700KB (~2 lines), which I think should be fine to be loaded into memory? I have two further questions though please, the lines are like this: