Method Call in Exception
Felipe Almeida Lessa
felipe.lessa at gmail.com
Wed Apr 19 20:21:43 EDT 2006
More information about the Python-list mailing list
Wed Apr 19 20:21:43 EDT 2006
- Previous message (by thread): Method Call in Exception
- Next message (by thread): Method Call in Exception
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Em Qua, 2006-04-19 às 16:54 -0700, mwt escreveu:
> This works when I try it, but I feel vaguely uneasy about putting
> method calls in exception blocks.
What do you put in exception blocks?!
> So tell me, Brave Pythoneers, is this
> evil sorcery that I will end up regretting, or is it just plain good
> ol' Python magic?
IMHO, the exception block in Python is used a lot in places where you
could use an if-then-else, like your example that could be written as
if internet_available():
[...] #doing some internet stuff
else:
alternate_method_that_doesnt_need_internet()
So yes, I think there's no problem there.
--
Felipe.
- Previous message (by thread): Method Call in Exception
- Next message (by thread): Method Call in Exception
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list