Search code examples
pythonprintingpydoc

How to get Python 2.6 documentation of the future-imported print() function?


I use Python 2.6 with the new print() function:

from __future__ import print_function

Now, how can I get pydoc to print a documentation of that function? A simple

$ pydoc print

will print documentation about the 2.6 version of the print function.

(Needless to say, I can find the documentation online but I'd like to be able to access it using pydoc on the command line.)


Solution

  • Unfortunately there's no shortcut:

    $ python -c 'from __future__ import print_function; help(print)'