Modifying signature of ctor in class

gal kauffman gal.kauffman at gmail.com
Thu Sep 24 16:37:35 EDT 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>
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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150924/20f2ec51/attachment.html>


More information about the Python-list mailing list