-
https://github.com/python/cpython/blob/master/Doc/tutorial/errors.rst-
https://www.tutorialspoint.com/python/python_exceptions.htm
- If the docs don't answer the question (and match to the search terms), they probably should.
- [ ] DOC: something about why "except Exception: pass" is usually bad
You can get alot more traceback from pytest (w/ pytest-sugar) and/or nose (with nose-progressive).
There is extra information in the stack at exception time; but, IIUC, it would take a number of subclasses with class-specific docs and/or class introspection to be as detailed as "you probably wanted .append there because this is a List and the length is n but the key was".
Maybe a "learning mode" which automatically calls inspect.getdoc() on Exception would be useful (sys.excepthook)?
Practically, I usually just open an extra IPython shell and run `list.append?` for docs or `list.append??` for (Python but not C!) source (inspect.getsource).
IPython also prints the function signature with `?`
The pdb++ debugger requires funcsigs in order to print function signatures. If pdb++ is installed, it preempts the standard pdb module; so `nosetests --pdb` and `pytest --pdb` launch pdb++ when an error or exception is raised.