I have a lot of callable objects and they all have the __doc__
string correctly filled out, but running help on them produces the help for the their class instead of help based on __doc__
.
What I want to do is change it so that running help on them produces customized help that looks essentially like what you would get if they were actual functions instead of instances of a class that implements __call__
.
In code, what I'd like to do is make the output of this:
class myCallable:
def __init__(self, doc):
self.__doc__ = doc
def __call__(self):
# do some stuff
pass
myFunc = myCallable("some doco text")
help(myFunc)
Look more like the output of this
def myFunc():
"some doco text"
# do some stuff
pass
help(myFunc)