[Tutor] for/else question
Erik Price
erikprice at mac.com
Sun Sep 14 10:45:50 EDT 2003
On Friday, September 12, 2003, at 11:48 AM, Scott Widney wrote:
> It just doesn't fit. But there is a term in another statement in
> Python that
> seems closer to what I'm thinking:
>
> Try:
> something that might not work;
> if it fails:
> do this;
> finally (whether or not it worked):
> do this too.
>
> This "feels" more comfortable. Finally and afterwards are semantic
> neighbors. So if I think 'finally' in my head, but type 'else' when
> dealing
> with a for statement, it seems to relieve the pressure. And now we
> return to
> our regularly scheduled program....
Yeah, "finally" would have been a much better token to use here.
Erik
More information about the Tutor
mailing list