Closed GoogleCodeExporter closed 8 years ago
adam, thanks for your patch.
Unfortunately, there is a problem with the patch as it is.
inspect.getsource() only works for a function which is defined in a source file
on
disk and just because isinstance(fun, FunctionType) is true doesn't mean
getsource()
won't throw an exception.
However, I can't imagine a situation where practically speaking one would pass a
function object that wasn't from a source file. If you had the raw code to
begin with
you could just pass it along without compiling it to a function object.
I'm accepting this and assigning it to myself. I'll play around with it.
In the meantime, a workaround if you want to run views which are defined in .py
files
is to install your .py files into your python library for the environment the
view
server runs in and pass the string "from module import map_fun" for the map
function.
Original comment by randall....@gmail.com
on 28 Feb 2009 at 4:48
Randall, I have this patch integrated in my working copy already, and have even
added some decorator fu. I'll
check in after some more testing.
Original comment by cmlenz
on 28 Feb 2009 at 12:18
Patch plus decorator support checked in in r136.
Original comment by cmlenz
on 9 Mar 2009 at 9:39
Original issue reported on code.google.com by
adam.kocoloski@gmail.com
on 22 Dec 2008 at 5:08Attachments: