@@ -90,28 +90,31 @@ If you encounter :exc:`NameError`\s or pickling errors coming out of
9090New features
9191============
9292
93+ .. _whatsnew314-pep758 :
94+
9395PEP 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
9799parentheses to be omitted when there is only one exception type.
98100For 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