Message122116
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>
> _______________________________________
> |
|
Date |
User |
Action |
Args |
2010-11-22 12:58:58 | robcliffe | set | recipients:
+ robcliffe, georg.brandl, terry.reedy, belopolsky, ron_adam, eric.araujo, brian.curtin, henriquebastos, Rodolpho.Eckhardt |
2010-11-22 12:58:56 | robcliffe | link | issue8525 messages |
2010-11-22 12:58:56 | robcliffe | create | |
|