When I type help(\'string\')
in the python interpreter I get information about the string class. There,upper()
is indicated as a function. Yet I can on
You are creating an instance of that object and then calling help on that instance.
So these all work:
help(1)
help({})
help([])
help('')
help(dir)
help(help)
Help grabs the docstring for that instance, and gives it back to you. When you create your own objects, you can put in useful docstrings or whatever you want.