[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get docstring of a function ?
From: |
Ben Abbott |
Subject: |
Re: How to get docstring of a function ? |
Date: |
Wed, 12 May 2010 07:54:14 -0400 |
On May 11, 2010, at 3:26 PM, Jordi Gutiérrez Hermoso wrote:
> 2010/5/11 Søren Hauberg <address@hidden>:
>
>> Looking at your patch (I haven't tried it), I get the impression that
>>
>> a = help ("some_function");
>>
>> will return the docstring, but also display it.
>
> No, did you see the context? printf is actually used for displaying
> the docstring.
>
> I don't know what to do about argumentless help, though. I kinda like
> the idea of a table of contents but I also like manpages and concise
> documentation.
To help clarify the discussion, I patched the patch to ...
(1) avoid printing the docstring when it is returned as the output.
(2) fixed the docstring to be consistent with the behavior of "help" and
"docstring = help ('help')".
Now ...
(1) "help", gives instructions for how to access the documentation for the
command line.
(2) "txt = help ('help')", returns the docstring
(3) "help help" displays the docstring
(4) "txt = help" is the same as (1), but gives an error because there is no
docstring to return.
I didn't do anything about the TOC.
Ben
changeset.patch
Description: Binary data
- Re: How to get docstring of a function ?, (continued)
- Re: How to get docstring of a function ?, Ben Abbott, 2010/05/11
- Re: How to get docstring of a function ?, Jordi Gutiérrez Hermoso, 2010/05/11
- Re: How to get docstring of a function ?, Søren Hauberg, 2010/05/11
- Re: How to get docstring of a function ?, Jordi Gutiérrez Hermoso, 2010/05/11
- Re: How to get docstring of a function ?, Søren Hauberg, 2010/05/12
- Re: How to get docstring of a function ?, Jordi Gutiérrez Hermoso, 2010/05/12
- Re: How to get docstring of a function ?, Ben Abbott, 2010/05/12
- Re: How to get docstring of a function ?, Søren Hauberg, 2010/05/12
- Re: How to get docstring of a function ?, Ben Abbott, 2010/05/12
- Re: How to get docstring of a function ?, John W. Eaton, 2010/05/13
- Re: How to get docstring of a function ?,
Ben Abbott <=
Re: How to get docstring of a function ?, Ben Abbott, 2010/05/11