Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
86e1790c
Commit
86e1790c
authored
May 08, 2003
by
Greg Ward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify the dedent() example a bit by indenting the input lines unevenly.
parent
8f6329c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
Doc/lib/libtextwrap.tex
Doc/lib/libtextwrap.tex
+4
-4
Lib/textwrap.py
Lib/textwrap.py
+4
-4
No files found.
Doc/lib/libtextwrap.tex
View file @
86e1790c
...
...
@@ -59,11 +59,11 @@ For example:
def test():
# end first line with
\
to avoid the empty line!
s = '''
\
Hey
there
hello
world
'''
print repr(s) # prints '
Hey
\n
there
\n
'
print repr(dedent(s)) # prints '
Hey
\nthere
\n
'
print repr(s) # prints '
hello
\n
world
\n
'
print repr(dedent(s)) # prints '
hello
\n
world
\n
'
\end{verbatim}
\end{funcdesc}
...
...
Lib/textwrap.py
View file @
86e1790c
...
...
@@ -325,11 +325,11 @@ def dedent(text):
def test():
# end first line with
\
t
o avoid the empty line!
s = '''
\
Hey
there
hello
world
'''
print repr(s) # prints '
Hey
\
n
there
\
n
'
print repr(dedent(s)) # prints '
Hey
\
n
there
\
n
'
print repr(s) # prints '
hello
\
n
world
\
n
'
print repr(dedent(s)) # prints '
hello
\
n
world
\
n
'
"""
lines = text.expandtabs().split('
\
n
')
margin = None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment