cleaner way to write this?
bignose+hates-spam at benfinney.id.au
Thu Oct 26 01:42:39 CEST 2006
John Salerno <johnjsal at NOSPAMgmail.com> writes:
> if dlg.ShowModal() == wx.ID_OK:
> db_name = dlg.GetValue()
> return db_name
It's for reasons like this that I prefer to have only one 'return'
from my functions.
db_name = None
if dlg.ShowModal() == wx.ID_OK:
db_name = dlg.GetValue()
\ "I was trying to daydream, but my mind kept wandering." -- |
`\ Steven Wright |
More information about the Python-list