@@ -92,7 +92,7 @@ otherwise it is too easy for user code to inadvertently swallow exceptions
9292that it is not handling.
9393
9494The purpose of this PEP, then, is to add the ` except* ` syntax for handling
95- ` ExceptionGroups ` s in the interpreter, which in turn requires that
95+ ` ExceptionGroup ` s in the interpreter, which in turn requires that
9696` ExceptionGroup ` is added as a builtin type. The semantics of handling
9797` ExceptionGroup ` s are not backwards compatible with the current exception
9898handling semantics, so we are not proposing to modify the behavior of the
@@ -477,7 +477,7 @@ the original `ExceptionGroup`:
477477>> > try :
478478... try :
479479... raise ExceptionGroup(" eg" ,
480- ... [ValueError (1 ),
480+ ... [ValueError (1 ),
481481... TypeError (2 ),
482482... OSError (3 ),
483483... ExceptionGroup(
@@ -487,12 +487,12 @@ the original `ExceptionGroup`:
487487... print (f ' *ValueError: { e!r } ' )
488488... raise
489489... except * OSError as e:
490- ... print (f ' *OsError : { e!r } ' )
490+ ... print (f ' *OSError : { e!r } ' )
491491... except ExceptionGroup as e:
492492... print (repr (e))
493493...
494494* ValueError : ExceptionGroup(' eg' , [ValueError (1 ), ExceptionGroup(' nested' , [ValueError (6 )])])
495- * OsError : ExceptionGroup(' eg' , [OSError (3 ), ExceptionGroup(' nested' , [OSError (4 )])])
495+ * OSError : ExceptionGroup(' eg' , [OSError (3 ), ExceptionGroup(' nested' , [OSError (4 )])])
496496ExceptionGroup(' eg' , [ValueError (1 ), TypeError (2 ), ExceptionGroup(' nested' , [TypeError (5 ), ValueError (6 )])])
497497>> >
498498```
@@ -847,7 +847,7 @@ by `except (Exception, ExceptionGroup):` or `except *Exception:`.
847847raising ` ExceptionGroup ` needs to become ` except *T: ` , and its body may need
848848to be updated.
849849
850- * Libraries that need to support older python versions will not be able to use
850+ * Libraries that need to support older Python versions will not be able to use
851851` except* ` or raise ` ExceptionGroup ` s.
852852
853853
@@ -906,7 +906,7 @@ the traceback mechanism as it is and modify the traceback display code.
906906We considered introducing a new keyword (such as ` catch ` ) which can be used
907907to handle both plain exceptions and ` ExceptionGroup ` s. Its semantics would
908908be the same as those of ` except* ` when catching an ` ExceptionGroup ` , but
909- it would not wrap plain a exception to create an ` ExceptionGroup ` . This
909+ it would not wrap a plain exception to create an ` ExceptionGroup ` . This
910910would have been part of a long term plan to replace ` except ` by ` catch ` ,
911911but we decided that deprecating ` except ` in favour of an enhanced keyword
912912would be too confusing for users at this time, so it is more appropriate
@@ -920,7 +920,7 @@ possibly executing the same clause multiple times when it matches multiple
920920exceptions. We decided instead to execute each ` except* ` clause at most once,
921921giving it an ` ExceptionGroup ` that contains all matching exceptions. The reason
922922for this decision was the observation that when a program needs to know the
923- patricular context of an exception it is handling, it handles it before
923+ particular context of an exception it is handling, it handles it before
924924grouping it with other exceptions and raising them together.
925925
926926For example, ` KeyError ` is an exception that typically relates to a certain
@@ -974,7 +974,7 @@ If it does turn out to be necessary to make the distinction, it is always
974974possible to nest in the ` try-except* ` clause an additional ` try-except ` clause
975975which intercepts and handles a naked exception before the ` except* ` clause
976976has a change to wrap it in an ` ExceptionGroup ` . In this case the overhead
977- of specifying both is not addition burden - we really do need to write a
977+ of specifying both is not additional burden - we really do need to write a
978978separate code block to handle each case:
979979
980980``` python
0 commit comments