[Patches] [Patch #102989] Allow 'continue' inside 'try' clause

noreply@sourceforge.net noreply@sourceforge.net
Thu, 18 Jan 2001 09:32:13 -0800


Patch #102989 has been updated. 

Project: python
Category: core (C code)
Status: Open
Submitted by: twouters
Assigned to : jhylton
Summary: Allow 'continue' inside 'try' clause

Follow-Ups:

Date: 2001-Jan-18 09:32
By: jhylton

Comment:
I will take a look at this patch before 2.1a1.  I am trying to finish
up some fairly major compiler changes, so it seems natural to
review this patch next.

-------------------------------------------------------

Date: 2001-Jan-18 08:35
By: twouters

Comment:
It seems Jeremy doesn't have time to review it right now, either. Which is
not suprising, looking at the number of tasks assigned to him ;) Maybe
someone else can take a look at this ? It shouldn't be that hard, the patch
isn't *that* controversial, and it would be nice to have this in alpha1, I
do think.

The patch still applies fine, though it gives some harmless offset/fuzz
warnings. Also, you need either to bump the bytecode magic or remove all
.pyc files for it to actually matter (or run 'make distclean'.)

-------------------------------------------------------

Date: 2000-Dec-28 07:09
By: gvanrossum

Comment:
I don't have time to review this myself for now, so I've assigned it to
Jeremy, who is pretty familiar with the compiler and virtual machine.  I do
appreciate the effort very much!  If it works, it should go in.  (What's
the JPython situation?)
-------------------------------------------------------

Date: 2000-Dec-27 16:01
By: twouters

Comment:
Okay, really a new version now. (Forgot to click on 'Upload revised patch'
last time.)

Added documentation changes; the implementation-limitation of 'continue'
inside 'try' was less extensively documented than I feared, and actually
pretty incomplete. TeX code is untested, as I don't have network
connectivity on my laptop right now, and that's the only place I got Fred's
shakey LaTeX setup to work ;)

-------------------------------------------------------

Date: 2000-Dec-27 15:46
By: twouters

Comment:
New version, 'final' as far as I'm concerned, unless the Power that Is
prefers a 'PyFrame_GetCurrentBlock()' function over the ugly 'pop-and-push'
hack that the current patch uses.

Finally figured out why 'try: pass; finally: continue' wasn't raising the
proper error: it never did ! It's just a bug in the current implementation,
not this patch :)

Updated test suites, including a test for the newly functional syntax (in
test_grammar.) Not yet updated docs, those will follow. (Found another bug
in the docs: it says you can do 'continue' inside 'finally', but you never
could.)

-------------------------------------------------------

Date: 2000-Dec-21 14:01
By: twouters

Comment:
Slightly better version, that actually compiles ;P Not done yet, though,
the error for 'continue' inside 'finally' is still off.

-------------------------------------------------------

Date: 2000-Dec-21 13:23
By: twouters

Comment:
This patch allows the use of 'continue' inside the 'try' part of try/except
and try/finally. Allowing it inside the 'finally' clause requires more
tricky juggling, however. (Suggestions welcome, of course :)

The patch adds a new opcode, but does not update the bytecode magic.


-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=102989&group_id=5470