[New-bugs-announce] [issue46291] [doc] First argument to raise can also be BaseException

Gregor Titze report at bugs.python.org
Fri Jan 7 08:30:17 EST 2022


New submission from Gregor Titze <gregor.titze at gmail.com>:

The Python Tutorial describes the first argument to the raise statement as follows:

"""
This must be either an exception instance or an exception class (a class that derives from Exception).
"""
https://docs.python.org/3/tutorial/errors.html#raising-exceptions

However, the Python Language Reference states, that exceptions should be a subclass or instance of BaseException.
https://docs.python.org/3/reference/simple_stmts.html#grammar-token-python-grammar-raise_stmt

I think it would be correct, to adapt the Tutorial to match the Reference.

----------
assignee: docs at python
components: Documentation
messages: 409961
nosy: docs at python, gtitze
priority: normal
severity: normal
status: open
title: [doc] First argument to raise can also be BaseException
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46291>
_______________________________________


More information about the New-bugs-announce mailing list