A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-April/099613.html below:

[Python-Dev] Small suggestion re help(Exception)

[Python-Dev] Small suggestion re help(Exception) [Python-Dev] Small suggestion re help(Exception)Rob Cliffe rob.cliffe at btinternet.com
Wed Apr 21 18:17:55 CEST 2010
help() on an Exception class lists the method resolution order (effectively the inheritance hierarchy).
E.g. help(ArithmeticError) displays inter alia:

Method resolution order:
    ArithmeticError
    StandardError
    Exception
    BaseException
    __builtin__.object

Would it be possible for it also display the Python built-in SUBclasses of the class?  E.g. in the same example something like:

Built-in subclasses:
    FloatingPointError
    OverflowError
    ZeroDivisionError

This may seem pointless to grizzled old Python veterans who (maybe) know the inheritance hierarchy backwards, but for those of us with less experience I think it would be helpful, e.g.
(1) It would help to track down an Exception whose name you have forgotten.
(2) It would sometimes be illuminating, e.g. LookupError might be a bit obscure at first, until you see that it is the superclass of the familiar IndexError and KeyError.

Sorry, I'm not sure if I should send this sort of thing to Python-Ideas or Python-Dev, so please let me know gently which one I should (not) have sent it to.

Best wishes
Rob Cliffe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20100421/befb2b58/attachment-0001.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4