Modifying signature of ctor in class
gal.kauffman at gmail.com
Thu Sep 24 22:37:35 CEST 2015
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" <jcasale at activenetwerx.com>
> I have a class factory where I dynamically add a constructor to the class
> The method is a closure and works just fine, however to accommodate the
> input its signature is (*args, **kwargs).
> While I modify the doc strings, the ctor sig is not optimal. Without
> this a string and using eval, is there anything that can be done about
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list