New submission from Gregor Titze <gregor.ti...@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@python
components: Documentation
messages: 409961
nosy: docs@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue46291>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to