Author robcliffe
Recipients Rodolpho.Eckhardt, belopolsky, brian.curtin, eric.araujo, georg.brandl, henriquebastos, robcliffe, ron_adam, terry.reedy
Date 2010-11-22.12:58:56
SpamBayes Score 0.00121076
Marked as misclassified No
Message-id <4CEA690B.4010809@btinternet.com>
In-reply-to <1290389622.81.0.165922690352.issue8525@psf.upfronthosting.co.za>
Content
I would not be at all surprised if my patch could be simplified (in fact 
I'd be surprised if it couldn't).
However, I did try out your version on Python 2.5 specifically, and it 
did not work for me.
Trying it out on help(Exception), the relevant members of 
object.__subclasses__() viz.
<type 'exceptions.StandardError'>, <type 'exceptions.StopIteration'>  etc.
had a __module__attribute which equalled 'exceptions', not 'builtins'.
Best wishes
Rob Cliffe

On 22/11/2010 01:33, Alexander Belopolsky wrote:
> Alexander Belopolsky<belopolsky@users.sourceforge.net>  added the comment:
>
> The following passes tests in elp_8525.patch, but is much simpler:
>
> ===================================================================
> --- Lib/pydoc.py	(revision 86600)
> +++ Lib/pydoc.py	(working copy)
> @@ -1139,6 +1139,15 @@
>                   push('    ' + makename(base))
>               push('')
>
> +        # List the built-in subclasses, if any:
> +        subclasses = [cls.__name__ for cls in object.__subclasses__()
> +                      if cls.__module__ == 'builtins']
> +        if subclasses:
> +            push("Built-in subclasses:")
> +            for subclassname in sorted(subclasses):
> +                push('    ' + subclassname)
> +            push('')
> +
>           # Cute little class to pump out a horizontal rule between sections.
>           class HorizontalRule:
>               def __init__(self):
>
> ----------
> nosy: +belopolsky
>
> _______________________________________
> Python tracker<report@bugs.python.org>
> <http://bugs.python.org/issue8525>
> _______________________________________
>
History
Date User Action Args
2010-11-22 12:58:58robcliffesetrecipients: + robcliffe, georg.brandl, terry.reedy, belopolsky, ron_adam, eric.araujo, brian.curtin, henriquebastos, Rodolpho.Eckhardt
2010-11-22 12:58:56robcliffelinkissue8525 messages
2010-11-22 12:58:56robcliffecreate