Skip to content
This repository was archived by the owner on Apr 10, 2022. It is now read-only.

Commit 43a8d9f

Browse files
authored
Fix typos (#25)
1 parent a9068e4 commit 43a8d9f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

except_star.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ otherwise it is too easy for user code to inadvertently swallow exceptions
9292
that it is not handling.
9393

9494
The 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
9898
handling 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)])])
496496
ExceptionGroup('eg', [ValueError(1), TypeError(2), ExceptionGroup('nested', [TypeError(5), ValueError(6)])])
497497
>>>
498498
```
@@ -847,7 +847,7 @@ by `except (Exception, ExceptionGroup):` or `except *Exception:`.
847847
raising `ExceptionGroup` needs to become `except *T:`, and its body may need
848848
to 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.
906906
We considered introducing a new keyword (such as `catch`) which can be used
907907
to handle both plain exceptions and `ExceptionGroup`s. Its semantics would
908908
be 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
910910
would have been part of a long term plan to replace `except` by `catch`,
911911
but we decided that deprecating `except` in favour of an enhanced keyword
912912
would 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
920920
exceptions. We decided instead to execute each `except*` clause at most once,
921921
giving it an `ExceptionGroup` that contains all matching exceptions. The reason
922922
for 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
924924
grouping it with other exceptions and raising them together.
925925

926926
For 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
974974
possible to nest in the `try-except*` clause an additional `try-except` clause
975975
which intercepts and handles a naked exception before the `except*` clause
976976
has 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
978978
separate code block to handle each case:
979979

980980
```python

0 commit comments

Comments
 (0)