The Voidspace Techie Blog

Gravatar Oh, I thought the "usual" way to get around the expression restriction in lambdas was to use the compile() builtin:

>>> r = lambda: eval(compile("raise RuntimeError", '', 'exec'))
>>> r()
Traceback (most recent call last):
File "", line 1, in ?
File "", line 1, in
File "/usr/lib/python2.4/", line 1, in ?

RuntimeError

Using ctypes is impressively nasty here though


Gravatar Am I the only one who, upon seeing the doit home page, read that as "doLt"? ;-D


Name:

Email:

URL:

Comment:  ? 

 

Commenting by HaloScan