Skip to content

Commit 0d09ad2

Browse files
pablogsalpicnixzbrianschubert
authored
Apply suggestions from code review
Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Brian Schubert <[email protected]>
1 parent c836244 commit 0d09ad2

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,28 +90,31 @@ If you encounter :exc:`NameError`\s or pickling errors coming out of
9090
New features
9191
============
9292

93+
.. _whatsnew314-pep758:
94+
9395
PEP 758 – Allow except and except* expressions without parentheses
9496
------------------------------------------------------------------
9597

96-
The :keyword:`except` and :keyword:`except*` expressions now allow
98+
The :keyword:`except` and :keyword:`except* <except_star>` expressions now allow
9799
parentheses to be omitted when there is only one exception type.
98100
For example the following expressions are now valid:
99101

100102
.. code-block:: python
101103
102-
try:
103-
release_new_sleep_token_album()
104-
except AlbumNotFound, SongsTooGoodToBeReleased:
105-
print("Sorry, no new album this year.")
104+
try:
105+
release_new_sleep_token_album()
106+
except AlbumNotFound, SongsTooGoodToBeReleased:
107+
print("Sorry, no new album this year.")
106108
107-
try:
108-
release_new_sleep_token_album()
109-
except* AlbumNotFound, SongsTooGoodToBeReleased:
110-
print("Sorry, no new album this year.")
109+
try:
110+
release_new_sleep_token_album()
111+
except* AlbumNotFound, SongsTooGoodToBeReleased:
112+
print("Sorry, no new album this year.")
111113
112114
Check :pep:`758` for more details.
113115

114-
(Contributed by Pablo Galindo and Brett Cannon in :issue:`131831`.)
116+
(Contributed by Pablo Galindo and Brett Cannon in :gh:`131831`.)
117+
115118

116119
.. _whatsnew314-pep649:
117120

0 commit comments

Comments
 (0)