This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aroberge
Recipients aroberge, docs@python, gtitze, iritkatriel, sobolevn
Date 2022-01-07.20:26:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1641587180.39.0.761075195799.issue46291@roundup.psfhosted.org>
In-reply-to
Content
Irit:

Gregor indicates that, while the tutorial refers to "a class that derives from Exception", the Python Reference Language states exceptions should be subclasses of BaseException  (which Exception *is*).

You then invited Gregor to submit a patch to change the wording of the tutorial (implying that it would refer to a class that derives from BaseException).

I pointed out that the advice given elsewhere is that user-defined exceptions should derive from Exception (thus, not from BaseException), so that nothing should be changed in the tutorial, and no change should be submitted.

So, as I understand it: there is a strict hierarchy of exceptions classes, all inheriting from BaseException. However, user-defined exceptions should be derived from Exception (and not BaseException), as indicated in the tutorial and on the page describing what each exception indicates. If that is correct, nothing needs to be changed in the tutorial.
History
Date User Action Args
2022-01-07 20:26:20arobergesetrecipients: + aroberge, docs@python, sobolevn, iritkatriel, gtitze
2022-01-07 20:26:20arobergesetmessageid: <1641587180.39.0.761075195799.issue46291@roundup.psfhosted.org>
2022-01-07 20:26:20arobergelinkissue46291 messages
2022-01-07 20:26:20arobergecreate