Problem with Help when using numarray

Fredrik Lundh fredrik at pythonware.com
Fri Sep 16 13:28:38 EDT 2005


Colin J. Williams wrote:

> With numarray, help gives unhelpful responses:
>
> import numarray.numarraycore as _n
> c= _n.array((1, 2))
> print 'rank Value:', c.rank
> print 'c.rank Help:', help(c.rank)

c.rank returns a Python integer object.

if you pass in an object to help(), help figures out what that object is,
and tries to tell you what you can do with that object.

the integer itself has no idea whatsoever from where it came; it's just
an integer, and that's all Python knows about it.

cf.

>>> import sys
>>> help(sys)
Help on built-in module sys:
NAME
    sys

>>> help(sys.stdout)
Help on file object:
class file(object)
 |  file(name[, mode[, buffering]]) -> file object

>>> help(sys.stdout.softspace)
Help on int object:
class int(object)

>>> help(sys.stdout.softspace.__int__)
Help on method-wrapper object:
__int__ = class method-wrapper(object)

and so on.

</F> 






More information about the Python-list mailing list