Op 2005-12-07, Christophe schreef <[EMAIL PROTECTED]>:
> Paul Rubin a écrit :
>> 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:
>> ...
>>
>> looks syntactically invalid.
>
> You shouldn't put "end" before the except but after :
>
> try:
> ...
> except blah:
> ...
> end
What I was wondering about. Some year back or longer someone
suggested a module he had written could help those who like
end markers.
He had written a function 'end' you could use as follows and
that would check if it ended the right block.
if ...:
...
end('if')
Can anyone recall? I have tried google to find it back, but
no luck. A pointer would be much appreciated.
--
Antoon Pardon
--
http://mail.python.org/mailman/listinfo/python-list