New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misstatement in example explanation using raise #51128
Comments
v2.6.2 Python Tutorial It appears that in the example, the original may have been: Currently:
"""
>>> raise NameError('HiThere')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: HiThere The first argument to raise names the exception to be raised. The Suggest change to:
"""
>>> raise NameError('HiThere')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: HiThere The first argument to raise names the exception to be raised. The |
The original was:
>>> raise NameError, 'HiThere'
Since now this form is deprecated, I would remove that paragraph altogether.
Instead, that paragraph should be replaced with:
"The sole argument to raise indicates the exception to be raised. This
must be either an exception instance or an exception class (a class that
derives from Exception)."
as it is now in the Py3 doc (possibly backporting r58076). |
Yes, that seems a good idea. |
Fixed in r74825 (trunk) and r74827 (release26-maint), thanks! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: