Author robcliffe
Recipients robcliffe
Date 2010-04-24.23:09:35
SpamBayes Score 4.42979e-14
Marked as misclassified No
Message-id <1272150602.3.0.323796636819.issue8525@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-04-24 23:10:05robcliffesetrecipients: + robcliffe
2010-04-24 23:10:02robcliffesetmessageid: <1272150602.3.0.323796636819.issue8525@psf.upfronthosting.co.za>
2010-04-24 23:10:00robcliffelinkissue8525 messages
2010-04-24 23:09:59robcliffecreate