>> Is it possible to have an 'except' case which passes control back to
>> the point after the exception occurred?
Peter> Basically no, although I could imagine some gross hack with the
Peter> frame info and some bytecode hacks that effect a "goto".
Someone (I forget who) posted an autoload module (appended) awhile ago for
Python that does a reasonable job of recovery in the case of
use-before-import. I modified it slightly and use it on my laptop.
Examples:
% python
Python 2.5a0 (#77, May 14 2005, 14:47:06)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1671)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> time.time()
found time in xmlrpclib module
1118752288.5277729
>>> datetime.datetime.now()
found datetime in xmlrpclib module
datetime.datetime(2005, 6, 14, 7, 31, 43, 136432)
>>> math.sin(7)
autoloading math
0.65698659871878906
Note that it's far from perfect (to wit: the weird fact that "time" and
"datetime" are found in the xmlrpclib module).
Skip
bint2TmtDAgpX.bin
Description: Binary data
-- http://mail.python.org/mailman/listinfo/python-list
