Op 2005-12-07, Paul Rubin schreef <http>:
> Antoon Pardon <[EMAIL PROTECTED]> writes:
>> But lately I have been wondering about doing the following:
>> end = None
>> ...
>> if ...:
>> ...
>> end
>> IMO it looks better, but I'm reluctant because it suggest
>> some checking by the compilor, which just doesn't happen.
>
> I don't think you can always do that.
>
> try:
> ...
> end
> except blah:
> ...
IMO this is the wrong way to use end.
end should be used to mark the end of a compound statement,
not the end of a suite. If a suite ending is already clear
because the next clause of the compound statement is beginning,
we don't need an extra marker to make that clear.
So the above should be:
try:
...
except blah:
...
end
--
Antoon Pardon
--
http://mail.python.org/mailman/listinfo/python-list