On Fri, Mar 16, 2012 at 8:45 AM, Doug Blank <doug.bl...@gmail.com> wrote:
> Can you think of *any* workaround on the C# side? Nothing I have tried
> will allow me to get a Python-based function (lambda, PythonFunction,
> builtin) out of an IList as a Func.

If you're in C# 4 this should work:

    void test3(IList<dynamic> functions) {
        return (Func<object>)functions[0];
    }

If not (or C# 3.5), you'll need to use DynamicOperations (totally untested!):
    void test4(CodeContext context, IList<object> functions) {
        return new
DynamicOperations(context.LanguageContext).ConvertTo<Func<object>>(functions[0]);
    }

- Jeff
_______________________________________________
Ironpython-users mailing list
Ironpython-users@python.org
http://mail.python.org/mailman/listinfo/ironpython-users

Reply via email to