howto redirect and extend help content ?

karoly.kiripolszky karoly.kiripolszky at gmail.com
Sun Jan 28 11:06:58 EST 2007


maybe you should make use of the objects' __doc__ attribute which 
holds the appropriate docstring. try to append something to it in the 
constructor. :)

more on this in the manual:

http://docs.python.org/tut/node11.html#SECTION0011300000000000000000

On Jan 28, 4:58 pm, Stef Mientki <S.Mientki-nos... at mailbox.kun.nl> 
wrote:
> I'm making special versions of existing functions,
> and now I want the help-text of the newly created function to exists of
> 1. an extra line from my new function
> 2. all the help text from the old function
>
> # the old function
> def triang(M,sym=1):
>      """The M-point triangular window.    <== old help text
>      """
>      ....
>
> # the new function
> def chunked_triang(M):
>      """ Chunked version of "triang"      <== the extra line
>      """
>
>  >>> help(chunked_triang)
> # should give something like
>
> chunked_triang(M)                        <== the new definition
>      Chunked version of "triang"          <== the extra line
>      The M-point triangular window.       <== old help text
>
> Is that possible ?
>
> thanks,
> Stef Mientki




More information about the Python-list mailing list