Message104134
help() on an exception class lists the method resolution order, which is in effect the class inheritance hierarchy. E.g. help(ArithmeticError) lists ArithmeticError, StandardError, Exception, BaseException, __builtin__.object. It struck me it would help to find my way around if it also listed the builtin SUBclasses (if any). Something like:
Built-in subclasses:
FloatingPointError
OverflowError
ZeroDivisionError
In fact why not do it for any class, not just exceptions?
I attach a patched version of pydoc.py - tested but only on my PC which is running Python 2.5 under Windows XP. I have added lines 1129-1148 to the docclass method of the TextDoc class (and flagged them # [RAC] ).
(I don't pretend to understand the magic where __builtins__ is a dictionary when pydoc.py is run but becomes a module later on. Never mind - the patch works (I believe).)
For consistency, a similar patch would also have to be made to the docclass nethod of the HTMLDoc class (which outputs HTML rather than plain text). I have not attempted this as I don't know how it is called and hence how to test any patch, but it should be straightforward for anyone with the know-how. |
|
Date |
User |
Action |
Args |
2010-04-24 23:10:05 | robcliffe | set | recipients:
+ robcliffe |
2010-04-24 23:10:02 | robcliffe | set | messageid: <1272150602.3.0.323796636819.issue8525@psf.upfronthosting.co.za> |
2010-04-24 23:10:00 | robcliffe | link | issue8525 messages |
2010-04-24 23:09:59 | robcliffe | create | |
|