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.
--
http://mail.python.org/mailman/listinfo/python-list