Possible Duplicate:
Inconsistency in python help(‘string’) versus help(list)?
In the interactive shell of Python, if I type help(42) I get all the information about int objects. If I type help("") I get nothing and if I type help("x") I get “no Python documentation found for ‘x'”.
I know I can type help(str), but I’d like to understand why are the other two working differently from help(42)?
See the documentation on the help function:
In other words, when
helpis given a class or type, it returns help on that class or type.When
helpis given any instance other than a string, likehelp(1), it provides documentation on the type of that variable (int,float, or a defined class).When it is given a string, it provides documentation on the type or class that that string refers to. If you want help with the
strclass itself, you can do:or