Paul Rubin wrote: > John Salerno <[EMAIL PROTECTED]> writes: > >> if dlg.ShowModal() == wx.ID_OK: >> db_name = dlg.GetValue() >> dlg.Destroy() >> return db_name >> else: >> dlg.Destroy() >> return > > > I like > > if dlg.ShowModal() == wx.ID_OK: > db_name = dlg.GetValue() > else: > db_name = None > dlg.Destroy() > return db_name > > better than > > db_name = None > if dlg.ShowModal() == wx.ID_OK: > db_name = dlg.GetValue() > dlg.Destroy() > return db_name > > but I suppose it's a matter of preference.
Of course, in 2.5 you can write db_name = dlg.GetValue() if dlg.ShowModal() == wx.ID_OK else None dlg.Destroy() return db_name but frankly I think this is horrible. I suspect we'd better get used to it, though ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list