How to create a docstring for a module?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Dec 8 17:22:44 EST 2009


En Sun, 06 Dec 2009 23:51:30 -0300, alex23 <wuwei23 at gmail.com> escribió:
> "Phillip M. Feldman" <pfeld... at verizon.net> wrote:

>> It does seem as though IPython could be a bit more clever about this.
>
> I disagree. I _like_ that IPython is only reporting on the current
> state of the interpreter and not trying to second guess what I meant.
>
>> If the user asks for documentation on xyz via "?xyz" and xyz is not
>> defined, then I'd like to see IPython check for a module named "xyz" and
>> if it exists, extract and display the docstring.
>
> How would you recommend IPython distinguish between which "xyz" you
> meant: the one in site-packages, the one in some package on the python
> path, or the one in the folder you're running IPython from?

The "xyz" that would be imported by executing "import xyz", I'd say.
The standard interpreter does that:

Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500
  32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more in
formation.
py> help("poplib")
Help on module poplib:

NAME
     poplib - A POP3 client class.
...

-- 
Gabriel Genellina




More information about the Python-list mailing list