Ron Adam wrote:
> It occurred to me (a few weeks ago while trying to find the best way to
> form a if-elif-else block, that on a very general level, an 'also'
> statement might be useful. So I was wondering what others would think
> of it.
But the feature is already there:
for x in <iterable>:
BLOCK1
if <condition>:
ALSO-BLOCK
break
else:
BLOCK2
If find "else" fine, since the only times I used it is in searches:
for x in <iterable>
BLOCK1
if <gotcha-condition>: break
else:
raise Exception('Not found')
In that case, 'else' sounds like the good keyword.
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list