ipython/ipython — pull request #5604 by nthiery (2014-04-13 08:14:36+00:00)
Title: #5603: Provide online documentation for Python's keywords and operators

This is a proof of concept implementation. It implements keyword lookup in pdoc and provides draft of documentation for::

>>>> for?
>>>> if?

as well as `continue`, `break`, `elif`, `else`.

What remains to be done:
1. Finalize the documentation for `for` and `if` (in particular: markup for examples, style, ...) as a template for the other keywords.
2. Write the documentation for all the Python keywords.
3. Maybe improve the rendering of documentation for Python keywords (e.g. we don't really care about the lines `Type`, `BaseClass`, `String from`).
4. Implement online documentation for operators::

>>>> +?

It sounds like this would require to touch a bit the parser, which is beyond my current knowledge of the IPython infrastructure
5. I believe `+?` should yield the documentation of `operator.add`, and similarly for the other operators. Those docstrings deserve to be improved: at least mentioning the link with the corresponding __xxxx__ methods and linking to the Special methods section on docs.python.org (which might differ a bit for Python 2 or 3). I guess improving those docstrings needs to be done upstream in Python.

I alas won't have time to devote to this. I can probably find a volunteer among my fellow teachers for 2.