[Tutor] How much in a "try" block?

Chris Down chris at chrisdown.name
Fri Aug 23 12:55:45 CEST 2013


On 2013-08-23 01:30, Alan Gauld wrote:
> Unless you really only want g(x) executed if there is no MyError exception
> but want h(x) executed regardless.

I've had that situation a few times before when using the logic "try this, or
fall back to this if it doesn't work".

> I'm curious, how often do others use the try/else combination?

Rarely. I think I've only used it twice in recent memory.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tutor/attachments/20130823/80f5c46c/attachment.sig>


More information about the Tutor mailing list