logo       

[ jython-Patches-868514 ] yield in finally block: msg#00016

lang.jython.devel

Subject: [ jython-Patches-868514 ] yield in finally block

Patches item #868514, was opened at 2003-12-31 09:03
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=312867&aid=868514&group_id=12867

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Randy Brown (lycotic)
Assigned to: Nobody/Anonymous (nobody)
Summary: yield in finally block

Initial Comment:
Following the advice of Samuele Pedroni (message to
python-dev of 2002-10-17 -- a while ago), reworked the way
yields and f_lasti are implemented to work with finally
blocks. Then spent a while arguing with the verifier.

The second file is some test cases I found useful;
test_generators in the CPython standard lib doesn't exercise
yields in finallys all that much.

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

Comment By: Nobody/Anonymous (nobody)
Date: 2004-01-05 10:46

Message:
Logged In: NO

ah, well it seems that sun cannot make up its mind

http://developer.java.sun.com/developer/bugParade/bugs/4739388.html

they have added a flag to get jsrs back.

pro to no jsrs:
- it simplifies the compiler code
- verification of jsr is one of the most delicate part of
bytecode
verif.
- speed, although reentering a generator in a finally clause
and yield in finally clauses are rather untypical

contra:
- code could blow up, deeply nested try-finally are not that
typical in Python but we emit more bytecode per line of code,
and if PEP 310 is accepted nesting try-finally will be even
easier, more common?

Having some measure about what kind of code lengths we could
get both ways would be good.






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

Comment By: Randy Brown (lycotic)
Date: 2004-01-05 10:16

Message:
Logged In: YES
user_id=920303

True, but I don't regret the learning experience. As I said
on the other patch, I think that inlining finallys won't be
so bad, especially with generators, so long as there aren't
too many exits from the try block and the finallys aren't
nested.

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

Comment By: Samuele Pedroni (pedronis)
Date: 2004-01-04 19:05

Message:
Logged In: YES
user_id=61408

oops, I didn't notice this patch [SF btw sofar didn't sent
any notification mail about these patches, strange.]

this is very good, but as I have written commenting another
patch sun switched away from jsr. At some point it would be
good to do the same. Not that this mean that this will not
go in , pending review.

There is a lesson still, it is a good idea before writing
any patch that is not trivial to ping jython-dev. I knew
since some time about sun change of strategy.

Thanks for the work.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=312867&aid=868514&group_id=12867


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise