You can use the FunctionType class found in the types module (and its friends) to create functions on the run. And you can use the 'inspect' module to inspect existing functions, if you need to base the new function on an existing one. On Sep 24, 2015 11:28 PM, "Joseph L. Casale" <jcas...@activenetwerx.com> wrote:
> I have a class factory where I dynamically add a constructor to the class > output. > The method is a closure and works just fine, however to accommodate the > varied > input its signature is (*args, **kwargs). > > While I modify the doc strings, the ctor sig is not optimal. Without > building > this a string and using eval, is there anything that can be done about > this? > > Thanks, > jlc > -- > https://mail.python.org/mailman/listinfo/python-list >
-- https://mail.python.org/mailman/listinfo/python-list