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)
|
||||
+-- ControlFlowException (new)
|
||||
+-- GeneratorExit (defined in PEP 342 [PEP342]_)
|
||||
+-- StopIteration (broader inheritance)
|
||||
+-- SystemExit (broader inheritance)
|
||||
+-- StopIteration (stricter inheritance)
|
||||
+-- SystemExit (stricter inheritance)
|
||||
+-- Exception
|
||||
+-- StandardError
|
||||
+-- ArithmeticError
|
||||
|
@ -273,6 +273,15 @@ entirely separate exception that will not be caught by a bare ``except``
|
|||
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
|
||||
'''''''''''''''''''
|
||||
|
||||
|
|
Loading…
Reference in New Issue