<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 21/04/2010 18:17, Rob Cliffe wrote:
<blockquote cite="mid:AD78DD45CAB840508522A8CD7C491A10@robslaptop"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.6001.18783">
<style></style>
<div><font face="Arial" size="2">help() on an Exception class lists
the method resolution order (effectively the inheritance hierarchy).</font></div>
<div><font face="Arial" size="2">E.g. help(ArithmeticError) displays
inter alia:</font></div>
<div> </div>
<div><font face="Arial" size="2">Method resolution order:</font></div>
<div><font face="Arial" size="2"> ArithmeticError</font></div>
<div><font face="Arial" size="2"> StandardError</font></div>
<div><font face="Arial" size="2"> Exception</font></div>
<div><font face="Arial" size="2"> BaseException</font></div>
<div><font face="Arial" size="2"> __builtin__.object</font></div>
<div> </div>
<div><font face="Arial" size="2">Would it be possible for it also
display the Python built-in SUBclasses of the class? E.g. in the same
example something like:</font></div>
<div> </div>
<div><font face="Arial" size="2">Built-in subclasses:</font></div>
<div><font face="Arial" size="2"> FloatingPointError</font></div>
<div><font face="Arial" size="2"> OverflowError</font></div>
<div><font face="Arial" size="2"> ZeroDivisionError</font></div>
<div> </div>
<div><font face="Arial" size="2">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.</font></div>
<div><font face="Arial" size="2">(1) It would help to track down an
Exception whose name you have forgotten.</font></div>
<div><font face="Arial" size="2">(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.</font></div>
<div> </div>
<div><font face="Arial" size="2">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.</font></div>
<div> </div>
</blockquote>
<br>
This sounds like a pretty straightforward feature request that you
could put on the tracker (preferably with patch and tests of course),
but is on-topic for this mailing list.<br>
<br>
I rarely use help(...) myself (I probably should), but it sounds like a
useful enhancement.<br>
<br>
Michael<br>
<br>
<blockquote cite="mid:AD78DD45CAB840508522A8CD7C491A10@robslaptop"
type="cite">
<div><font face="Arial" size="2">Best wishes</font></div>
<div><font face="Arial" size="2">Rob Cliffe</font></div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Python-Dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python-Dev@python.org">Python-Dev@python.org</a>
<a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/python-dev">http://mail.python.org/mailman/listinfo/python-dev</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk">http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.ironpythoninaction.com/">http://www.ironpythoninaction.com/</a></pre>
</body>
</html>