[Numpy-discussion] np.lookfor -- still supported / working ?

Sebastian Haase seb.haase at gmail.com
Sat Dec 11 17:40:35 EST 2010


Hi all,

I recently discovered numpy's lookfor function,
which is supposed to look through "all kinds" of doc strings and list
relevant functions related to given keywords.
However it does not seem to work for me:
>>> N.__version__
'1.3.0'
>>> N.lookfor('fft', module=None, import_modules=True, regenerate=False)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\cygwin\home\haase\Priithon_25_win\numpy\lib\utils.py", line
622, in lookfor
    found.sort(relevance_sort)
TypeError: comparison function must return int
>>> 1/2   # I use  from future import division ....
0.5
>>>

I especially like, that it is supposed to work for any other (not just
numpy or scipy) module.
But that also doesn't work:
>>> import wx
>>> N.lookfor('background', module='wx', import_modules=True, regenerate=False)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\cygwin\home\haase\Priithon_25_win\numpy\lib\utils.py", line
574, in lookfor
    cache = _lookfor_generate_cache(module, import_modules, regenerate)
  File "C:\cygwin\home\haase\Priithon_25_win\numpy\lib\utils.py", line
729, in _lookfor_generate_cache
    doc = inspect.getdoc(item)
  File "C:\cygwin\home\haase\Priithon_25_win\Python25\lib\inspect.py",
line 313, in getdoc
    doc = object.__doc__
NameError: Unknown C global variable
>>>

I tried it on more recent numpy (1.5.1 I think) and got same problems.
Any comments ?

Thanks,
Sebastian Haase



More information about the NumPy-Discussion mailing list