[SciPy-dev] Postponed imports and docstrings

Pearu Peterson pearu at scipy.org
Tue Nov 2 14:26:21 CST 2004



On Tue, 2 Nov 2004, Robert Kern wrote:

> Arnd Baecker noted on the IPython list that modules whose imports are 
> postponed have no docstring until the second time they are accessed. Normally 
> in IPython, one can get the docstring of an object by appending a ? to it. 
> E.g.:
>
> In[1] optimize?
>
> The real docstring doesn't appear until the second time one does the ? magic.
>
> How about putting a docstring for _ModuleLoader that calls attention to this 
> fact?
>
> """ATTENTION: this module's import has been postponed. You will not see
> the module's real documentation until the next time you access the
> module.
>
> Repeat your action to see the real documentation.
> """
>
> Does anyone have a better wording?

I'd rather fixing postponed import hooks. For example,

In [1]: from scipy import *

In [2]: help(optimize)

or

In [2]: info(optimize)

or

In [2]: info('optimize')

work as expected but not

In [2]: ?optimize

as you reported.

Fernando, could you point out which part of ipython implements `?..`
so that I could look into it and fix the in scipy_base/ppimport.py?

Pearu




More information about the Scipy-dev mailing list