Tuesday, 27 August 2013

Is there a way to generate IPython docstrings on the fly?

Is there a way to generate IPython docstrings on the fly?

I like that IPython will fetch docstrings if I type foo.bar?
However, I may sometimes build the foo.bar method dynamically, using
foo.__getattr__. I could conceivably also generate a docstring
dynamically, perhaps in a magic method like foo.__getdoc__.
Does IPython provide any mechanism for doing this, such that it would
discover and display docstrings built on the fly?

No comments:

Post a Comment