[Python-Dev] Next-to-last wart in Python syntax.

Thomas Wouters thomas@xs4all.net
Mon, 12 Mar 2001 22:04:31 +0100


Contrary to Guido's keynote last week <wink> there are still two warts I
know of in the current CPython. One is the fact that keywords cannot be used
as identifiers anywhere, the other is the fact that 'continue' can still not
be used inside a 'finally' clause. If I remember correctly, the latter isn't
too hard to fix, it just needs a decision on what it should do :)

Currently, falling out of a 'finally' block will reraise the exception, if
any. Using 'return' and 'break' will drop the exception and continue on as
usual. However, that makes sense (imho) mostly because 'break' will continue
past the try/finally block and 'return' will break out of the function
altogether. Neither have a chance of reentering the try/finally block
altogether. I'm not sure if that would make sense for 'continue' inside
'finally'.

On the other hand, I'm not sure if it makes sense for 'break' to continue
but for 'continue' to break. :)

As for the other wart, I still want to fix it, but I'm not sure when I get
the chance to grok the parser-generator enough to actually do it :) 

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!