why does "help(import)" not work?
Diez B. Roggisch
deets at nospam.web.de
Fri Nov 6 11:11:44 CET 2009
Robert P. J. Day schrieb:
> i'm sure there's a painfully obvious answer to this, but is there a
> reason i can't do:
> File "<stdin>", line 1
> 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?
import is a keyword, so the parser can't comprehend the expression you
created. In the same way it can't do it for
or any other keyword.
More information about the Python-list