"help( pi )"

Paul Moore p.f.moore at gmail.com
Fri Nov 17 08:40:14 EST 2017


On 17 November 2017 at 12:36, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
>   A web page says:
>
> “The argument to pydoc can be the name of a function,
> module, or package, or a dotted reference to a class,
> method, or function within a module or module in a package.”
[...]
>   , but not for »pi«:
>
> from math import pi
> help( pi )

math.pi is not "a class method, or function within a module or module
in a package". It's a number.

I can see why you would want to be able to do this, but technically
the help function shows the object's docstring, and numbers don't have
docstrings.

Paul



More information about the Python-list mailing list