1) From 2.4.2 documentation:
There are two new valid (semantic) forms for the raise statement:
raise Class, instance
raise instance
2) In python:[color=blue][color=green][color=darkred]
>>> raise NameError[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError[color=blue][color=green][color=darkred]
>>> help(NameError)[/color][/color][/color]
Help on class NameError in module exceptions: ...[color=blue][color=green][color=darkred]
>>> raise 0[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: exceptions must be classes, instances, or strings
(deprecated), not i
nt
So, if it's a bug in documentation, it should be corrected. Otherwise,
(IMHO!) raising classes should be deprecated. Does raising class make
sence? As for me, I can't find any usefull case for it.
There are two new valid (semantic) forms for the raise statement:
raise Class, instance
raise instance
2) In python:[color=blue][color=green][color=darkred]
>>> raise NameError[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError[color=blue][color=green][color=darkred]
>>> help(NameError)[/color][/color][/color]
Help on class NameError in module exceptions: ...[color=blue][color=green][color=darkred]
>>> raise 0[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: exceptions must be classes, instances, or strings
(deprecated), not i
nt
So, if it's a bug in documentation, it should be corrected. Otherwise,
(IMHO!) raising classes should be deprecated. Does raising class make
sence? As for me, I can't find any usefull case for it.
Comment