David wrote:
greg whittier wrote:
On Fri, Mar 27, 2009 at 1:31 PM, David <da...@abbottdavid.com> wrote:
But I can not get this to update after the first time it is ran.

def get_todo():

Other common ways this is done include:

def get_todo(todo={}):
    ...

This works well if one copy is to be used the entire time the application is live, although it's also often cited as a gotcha...


and

def get_todo(todo=None):
    if todo==None:
        todo = {}
    ...

Both the above allow you to pass in a starting todo dict, so you could juggle multiple todo dicts...

HTH,

Emile

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to