28

In IPython, I am used to write

function(

and then strike a tab, and get the contents of the docstring and a list of the named arguments. However, this stopped working since I installed IPython 2.0. Is there an explanation or a know fix?

58

Oh, the shortcut is now shift+tab.

| improve this answer | |
  • Works inside jupyter notebook, but sadly enough not inside ipython terminal... – Milo Wielondek Nov 5 at 14:49
4

Shift-tab only works when you place the edit cursor inside or after the object. Not when it's at the start of the object. This gotcha is not documented anywhere...!

I filed jupyter issue Shift-Tab completion doesn't work when edit cursor is at the start of the object #1902

| improve this answer | |
  • been wondering why none of my docstrings were showing up hahaha.. thanks – thomas.mac Aug 1 '18 at 1:52
1

To display docstrings in Python one can use ? character as a shorthand.

You can place the ? character before or after (no space allowed) the object you are looking for docs.

To access the source code simply use ?? instead.

Source: Help and Documentation in IPython

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.