[issue21864] Error in documentation of point 9.8 'Exceptions are classes too'

2014-06-24 Thread Peibolvig

New submission from Peibolvig:

At point 9.8 of the 3.4.1 version documentation, ( 
https://docs.python.org/3/tutorial/classes.html#exceptions-are-classes-too ), 
there is an example of two ways to use the 'raise' statement:
raise Class
raise Instance

The next two lines, state: 
"In the first form, Class must be an instance of type or of a class derived 
from it. The first form is a shorthand for: raise Class()"

That only says something about the first form twice.
I think that the correct way would be:
"In the first form, Class must be an instance of type or of a class derived 
from it. The SECOND form is a shorthand for: raise Class()"

--
assignee: docs@python
components: Documentation
messages: 221511
nosy: Peibolvig, docs@python
priority: normal
severity: normal
status: open
title: Error in documentation of point 9.8 'Exceptions are classes too'
versions: Python 3.4

___
Python tracker 
<http://bugs.python.org/issue21864>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21864] Error in documentation of point 9.8 'Exceptions are classes too'

2014-06-24 Thread Peibolvig

Peibolvig added the comment:

Oh, I see. Thanks for the clarification.

May I suggest to include that clarification into the documentation somehow? I 
think it would be easier to understand the point of the raises doing that.

Maybe this suggestion could fit:
In the first form, Class must be an instance of type or of a class derived from 
it. The first form is a shorthand for:
raise Class()
"'raise' will always use an instance. If a class is passed instead of an 
instance, it will instantiate it first using the constructor with no arguments."


Again, thanks for the clarification.

--

___
Python tracker 
<http://bugs.python.org/issue21864>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com