why does "help(import)" not work?

Chris Rebert clp2 at rebertia.com
Fri Nov 6 05:12:09 EST 2009


On Fri, Nov 6, 2009 at 1:56 AM, Robert P. J. Day <rpjday at crashcourse.ca> wrote:
>  i'm sure there's a painfully obvious answer to this, but is there a
> reason i can't do:
>
>>>> help(import)
>  File "<stdin>", line 1
>    help(import)
>              ^
> SyntaxError: invalid syntax
>>>>
>
>  on the other hand, i can certainly go into "help()" and type
> "import" to get that help.  it seems counter-intuitive to have the
> first variation fail but the second succeed.
>
>  what is the rule for this in python3?

"Special cases aren't special enough to break the rules."
-- Zen of Python (http://www.python.org/dev/peps/pep-0020/)

It would take a hideous kludge to make help(import) work.

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list