Change note on StopIteration and SystemExit on how they now have stricter
inheritance thanks to no longer inheriting from Exception.
This commit is contained in:
parent
0845f3255e
commit
3ad5689ae8
13
pep-0348.txt
13
pep-0348.txt
|
@ -85,8 +85,8 @@ New Hierarchy
|
||||||
+-- SystemError (stricter inheritance)
|
+-- SystemError (stricter inheritance)
|
||||||
+-- ControlFlowException (new)
|
+-- ControlFlowException (new)
|
||||||
+-- GeneratorExit (defined in PEP 342 [PEP342]_)
|
+-- GeneratorExit (defined in PEP 342 [PEP342]_)
|
||||||
+-- StopIteration (broader inheritance)
|
+-- StopIteration (stricter inheritance)
|
||||||
+-- SystemExit (broader inheritance)
|
+-- SystemExit (stricter inheritance)
|
||||||
+-- Exception
|
+-- Exception
|
||||||
+-- StandardError
|
+-- StandardError
|
||||||
+-- ArithmeticError
|
+-- ArithmeticError
|
||||||
|
@ -273,6 +273,15 @@ entirely separate exception that will not be caught by a bare ``except``
|
||||||
clause.
|
clause.
|
||||||
|
|
||||||
|
|
||||||
|
StopIteration and SystemExit
|
||||||
|
''''''''''''''''''''''''''''
|
||||||
|
|
||||||
|
Inherit from ControlFlowException instead of Exception.
|
||||||
|
|
||||||
|
By having these exceptions no longer inherit from Exception they will not be
|
||||||
|
accidentally caught by a bare ``except`` clause.
|
||||||
|
|
||||||
|
|
||||||
NotImplementedError
|
NotImplementedError
|
||||||
'''''''''''''''''''
|
'''''''''''''''''''
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue