On 02/12/2013 12:32 PM, neubyr wrote:
On Mon, Feb 11, 2013 at 7:34 PM, Steven D'Aprano <st...@pearwood.info>wrote:

<snip>

I am not following your comment on opening books file twice in
list_by_author method. I have opened it only once and then reading each
line while checking for a regex match. Am I missing something?


Not tiwce, 490 times. Each time you call that method, you're going to open and read the whole file? Why on earth would you do that, rather than just storing the Book instances in a list for later perusal? Read the file when starting, and save it when quitting. You did say you were going to be inserting and deleting books, right? You sure don't want to write that code to manage a text file.


--
DaveA
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to