@@ -221,116 +221,116 @@ have been incorporated. Some of the most notable ones are as follows:
221221
222222* Missing `` :`` before blocks:
223223
224- .. code- block:: python
224+ .. code- block:: python
225225
226- >> > if rocket.position > event_horizon
227- File " <stdin>" , line 1
228- if rocket.position > event_horizon
229- ^
230- SyntaxError : expected ' :'
226+ >> > if rocket.position > event_horizon
227+ File " <stdin>" , line 1
228+ if rocket.position > event_horizon
229+ ^
230+ SyntaxError : expected ' :'
231231
232- (Contributed by Pablo Galindo in :issue:`42997 ` .)
232+ (Contributed by Pablo Galindo in :issue:`42997 ` .)
233233
234234* Unparenthesised tuples in comprehensions targets:
235235
236- .. code- block:: python
236+ .. code- block:: python
237237
238- >> > {x,y for x,y in zip (' abcd' , ' 1234' )}
239- File " <stdin>" , line 1
240- {x,y for x,y in zip (' abcd' , ' 1234' )}
241- ^
242- SyntaxError : did you forget parentheses around the comprehension target?
238+ >> > {x,y for x,y in zip (' abcd' , ' 1234' )}
239+ File " <stdin>" , line 1
240+ {x,y for x,y in zip (' abcd' , ' 1234' )}
241+ ^
242+ SyntaxError : did you forget parentheses around the comprehension target?
243243
244- (Contributed by Pablo Galindo in :issue:`43017 ` .)
244+ (Contributed by Pablo Galindo in :issue:`43017 ` .)
245245
246246* Missing commas in collection literals and between expressions:
247247
248- .. code- block:: python
248+ .. code- block:: python
249249
250- >> > items = {
251- ... x: 1 ,
252- ... y: 2
253- ... z: 3 ,
254- File " <stdin>" , line 3
255- y: 2
256- ^
257- SyntaxError : invalid syntax. Perhaps you forgot a comma?
250+ >> > items = {
251+ ... x: 1 ,
252+ ... y: 2
253+ ... z: 3 ,
254+ File " <stdin>" , line 3
255+ y: 2
256+ ^
257+ SyntaxError : invalid syntax. Perhaps you forgot a comma?
258258
259- (Contributed by Pablo Galindo in :issue:`43822 ` .)
259+ (Contributed by Pablo Galindo in :issue:`43822 ` .)
260260
261261* Multiple Exception types without parentheses:
262262
263- .. code- block:: python
263+ .. code- block:: python
264264
265- >> > try :
266- ... build_dyson_sphere()
267- ... except NotEnoughScienceError, NotEnoughResourcesError:
268- File " <stdin>" , line 3
269- except NotEnoughScienceError, NotEnoughResourcesError:
270- ^
271- SyntaxError : multiple exception types must be parenthesized
265+ >> > try :
266+ ... build_dyson_sphere()
267+ ... except NotEnoughScienceError, NotEnoughResourcesError:
268+ File " <stdin>" , line 3
269+ except NotEnoughScienceError, NotEnoughResourcesError:
270+ ^
271+ SyntaxError : multiple exception types must be parenthesized
272272
273- (Contributed by Pablo Galindo in :issue:`43149 ` .)
273+ (Contributed by Pablo Galindo in :issue:`43149 ` .)
274274
275275* Missing `` :`` and values in dictionary literals:
276276
277- .. code- block:: python
277+ .. code- block:: python
278278
279- >> > values = {
280- ... x: 1 ,
281- ... y: 2 ,
282- ... z:
283- ... }
284- File " <stdin>" , line 4
285- z:
286- ^
287- SyntaxError : expression expected after dictionary key and ' :'
279+ >> > values = {
280+ ... x: 1 ,
281+ ... y: 2 ,
282+ ... z:
283+ ... }
284+ File " <stdin>" , line 4
285+ z:
286+ ^
287+ SyntaxError : expression expected after dictionary key and ' :'
288288
289- >> > values = {x:1 , y:2 , z w:3 }
290- File " <stdin>" , line 1
291- values = {x:1 , y:2 , z w:3 }
292- ^
293- SyntaxError : ' :' expected after dictionary key
289+ >> > values = {x:1 , y:2 , z w:3 }
290+ File " <stdin>" , line 1
291+ values = {x:1 , y:2 , z w:3 }
292+ ^
293+ SyntaxError : ' :' expected after dictionary key
294294
295- (Contributed by Pablo Galindo in :issue:`43823 ` .)
295+ (Contributed by Pablo Galindo in :issue:`43823 ` .)
296296
297297* `` try `` blocks without `` except `` or `` finally `` blocks:
298298
299- .. code- block:: python
299+ .. code- block:: python
300300
301- >> > try :
302- ... x = 2
303- ... something = 3
304- File " <stdin>" , line 3
305- something = 3
306- ^^^^^^^^^
307- SyntaxError : expected ' except' or ' finally' block
301+ >> > try :
302+ ... x = 2
303+ ... something = 3
304+ File " <stdin>" , line 3
305+ something = 3
306+ ^^^^^^^^^
307+ SyntaxError : expected ' except' or ' finally' block
308308
309- (Contributed by Pablo Galindo in :issue:`44305 ` .)
309+ (Contributed by Pablo Galindo in :issue:`44305 ` .)
310310
311311* Usage of `` =`` instead of `` == `` in comparisons:
312312
313- .. code- block:: python
313+ .. code- block:: python
314314
315- >> > if rocket.position = event_horizon:
316- File " <stdin>" , line 1
317- if rocket.position = event_horizon:
318- ^
319- SyntaxError : cannot assign to attribute here. Maybe you meant ' ==' instead of ' =' ?
315+ >> > if rocket.position = event_horizon:
316+ File " <stdin>" , line 1
317+ if rocket.position = event_horizon:
318+ ^
319+ SyntaxError : cannot assign to attribute here. Maybe you meant ' ==' instead of ' =' ?
320320
321- (Contributed by Pablo Galindo in :issue:`43797 ` .)
321+ (Contributed by Pablo Galindo in :issue:`43797 ` .)
322322
323323* Usage of `` * `` in f- strings:
324324
325- .. code- block:: python
325+ .. code- block:: python
326326
327- >> > f " Black holes { * all_black_holes} and revelations "
328- File " <stdin>" , line 1
329- (* all_black_holes)
330- ^
331- SyntaxError : f- string: cannot use starred expression here
327+ >> > f " Black holes { * all_black_holes} and revelations "
328+ File " <stdin>" , line 1
329+ (* all_black_holes)
330+ ^
331+ SyntaxError : f- string: cannot use starred expression here
332332
333- (Contributed by Pablo Galindo in :issue:`41064 ` .)
333+ (Contributed by Pablo Galindo in :issue:`41064 ` .)
334334
335335IndentationErrors
336336~~~~~~~~~~~~~~~~~
@@ -365,10 +365,10 @@ raised from:
365365
366366(Contributed by Pablo Galindo in :issue:`38530 ` .)
367367
368- .. warning::
369- Notice this won' t work if :c:func:`PyErr_Display` is not called to display the error
370- which can happen if some other custom error display function is used. This is a common
371- scenario in some REPLs like IPython.
368+ .. warning::
369+ Notice this won' t work if :c:func:`PyErr_Display` is not called to display the error
370+ which can happen if some other custom error display function is used. This is a common
371+ scenario in some REPLs like IPython.
372372
373373NameErrors
374374~~~~~~~~~~
@@ -387,10 +387,10 @@ was raised from:
387387
388388(Contributed by Pablo Galindo in :issue:`38530 ` .)
389389
390- .. warning::
391- Notice this won' t work if :c:func:`PyErr_Display` is not called to display the error,
392- which can happen if some other custom error display function is used. This is a common
393- scenario in some REPLs like IPython.
390+ .. warning::
391+ Notice this won' t work if :c:func:`PyErr_Display` is not called to display the error,
392+ which can happen if some other custom error display function is used. This is a common
393+ scenario in some REPLs like IPython.
394394
395395
396396PEP 626 : Precise line numbers for debugging and other tools
@@ -433,16 +433,16 @@ A match statement takes an expression and compares its value to successive
433433patterns given as one or more case blocks. Specifically, pattern matching
434434operates by:
435435
436- 1 . using data with type and shape (the `` subject`` )
437- 2 . evaluating the `` subject`` in the `` match`` statement
438- 3 . comparing the subject with each pattern in a `` case`` statement
439- from top to bottom until a match is confirmed.
440- 4 . executing the action associated with the pattern of the confirmed
441- match
442- 5 . If an exact match is not confirmed, the last case, a wildcard `` _`` ,
443- if provided, will be used as the matching case. If an exact match is
444- not confirmed and a wildcard case does not exist, the entire match
445- block is a no- op.
436+ 1 . using data with type and shape (the `` subject`` )
437+ 2 . evaluating the `` subject`` in the `` match`` statement
438+ 3 . comparing the subject with each pattern in a `` case`` statement
439+ from top to bottom until a match is confirmed.
440+ 4 . executing the action associated with the pattern of the confirmed
441+ match
442+ 5 . If an exact match is not confirmed, the last case, a wildcard `` _`` ,
443+ if provided, will be used as the matching case. If an exact match is
444+ not confirmed and a wildcard case does not exist, the entire match
445+ block is a no- op.
446446
447447Declarative approach
448448~~~~~~~~~~~~~~~~~~~~
@@ -2211,16 +2211,16 @@ Removed
22112211* Removed `` Py_UNICODE_str* `` functions manipulating `` Py_UNICODE* `` strings.
22122212 (Contributed by Inada Naoki in :issue:`41123 ` .)
22132213
2214- * `` Py_UNICODE_strlen`` : use :c:func:`PyUnicode_GetLength` or
2215- :c:macro:`PyUnicode_GET_LENGTH`
2216- * `` Py_UNICODE_strcat`` : use :c:func:`PyUnicode_CopyCharacters` or
2217- :c:func:`PyUnicode_FromFormat`
2218- * `` Py_UNICODE_strcpy`` , `` Py_UNICODE_strncpy`` : use
2219- :c:func:`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`
2220- * `` Py_UNICODE_strcmp`` : use :c:func:`PyUnicode_Compare`
2221- * `` Py_UNICODE_strncmp`` : use :c:func:`PyUnicode_Tailmatch`
2222- * `` Py_UNICODE_strchr`` , `` Py_UNICODE_strrchr`` : use
2223- :c:func:`PyUnicode_FindChar`
2214+ * `` Py_UNICODE_strlen`` : use :c:func:`PyUnicode_GetLength` or
2215+ :c:macro:`PyUnicode_GET_LENGTH`
2216+ * `` Py_UNICODE_strcat`` : use :c:func:`PyUnicode_CopyCharacters` or
2217+ :c:func:`PyUnicode_FromFormat`
2218+ * `` Py_UNICODE_strcpy`` , `` Py_UNICODE_strncpy`` : use
2219+ :c:func:`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`
2220+ * `` Py_UNICODE_strcmp`` : use :c:func:`PyUnicode_Compare`
2221+ * `` Py_UNICODE_strncmp`` : use :c:func:`PyUnicode_Tailmatch`
2222+ * `` Py_UNICODE_strchr`` , `` Py_UNICODE_strrchr`` : use
2223+ :c:func:`PyUnicode_FindChar`
22242224
22252225* Removed `` PyUnicode_GetMax()`` . Please migrate to new (:pep:`393 ` ) APIs.
22262226 (Contributed by Inada Naoki in :issue:`41103 ` .)
0 commit comments