Skip to content

Commit 67ff671

Browse files
committed
use _ to visualize spaces
1 parent 862cdfa commit 67ff671

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

peps/pep-0822.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,23 @@ This PEP proposes to add a feature that automatically removes indentation from m
2020

2121
Dedented multiline strings use a new prefix "d" (shorthand for "dedent") before the opening quote of a multiline string literal.
2222

23+
Example (spaces are visualized as `_`):
24+
2325
.. code-block:: python
2426
2527
def hello_paragraph() -> str:
26-
return d"""
27-
<p>
28-
Hello, World!
29-
</p>
30-
"""
28+
____return d"""
29+
________<p>
30+
__________Hello, World!
31+
________</p>
32+
____"""
3133
3234
The closing triple quotes control how much indentation would be removed.
33-
In the above example, the returned string will contain three lines:
35+
In the above example, the returned string will contain three lines
3436

35-
* ``" <p>\n"`` (four leading spaces)
36-
* ``" Hello, World!\n"`` (six leading spaces)
37-
* ``" </p>\n"`` (four leading spaces)
37+
* ``"____<p>\n"`` (four leading spaces)
38+
* ``"______Hello, World!\n"`` (six leading spaces)
39+
* ``"____</p>\n"`` (four leading spaces)
3840

3941

4042
Motivation

0 commit comments

Comments
 (0)