Author ncoghlan
Recipients CuriousLearner, Eric.Wieser, Rodolpho.Eckhardt, belopolsky, brian.curtin, eric.araujo, georg.brandl, henriquebastos, ncoghlan, robcliffe, ron_adam, terry.reedy
Date 2018-07-24.10:32:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532428374.84.0.56676864532.issue8525@psf.upfronthosting.co.za>
In-reply-to
Content
This is a UX problem folks: dynamic unbounded lists are inherently problematic in a line based information display.

For methods on a class, there's the natural constraint that broad class APIs are a problem for a variety of reasons, but there's no such design constraint for exception hierarchies.

In a Fedora Python 3.6 shell (with the Fedora abrt exception handling hook loaded), Exception has 31 subclasses, and OSError has 17.

In a 3.6 shell venv (with no Fedora abrt hook), those numbers are 20 and 13. 

But if you import assorted Django modules then the number of Exception subclasses grows significantly, while the number of OSError subclasses grows slightly:

>>> import django
>>> len(list(pkgutil.iter_modules(django.__path__)))
17
>>> len(Exception.__subclasses__())
76
>>> len(OSError.__subclasses__())
22

Having "help(Exception)" list 50+ different Django exceptions is unlikely to be informative for anyone.


In many ways, Python 2 was actually better in this regard, since you could just do "import exceptions; help(exceptions)" to get a nice overview of the full exception hierarchy using the standard logic for displaying.


The closest Python 3 currently gets to that is "import builtins; help(builtins)", which is significantly harder to discover.
History
Date User Action Args
2018-07-24 10:32:54ncoghlansetrecipients: + ncoghlan, georg.brandl, terry.reedy, belopolsky, ron_adam, eric.araujo, brian.curtin, robcliffe, henriquebastos, Rodolpho.Eckhardt, Eric.Wieser, CuriousLearner
2018-07-24 10:32:54ncoghlansetmessageid: <1532428374.84.0.56676864532.issue8525@psf.upfronthosting.co.za>
2018-07-24 10:32:54ncoghlanlinkissue8525 messages
2018-07-24 10:32:54ncoghlancreate