8000 Minor improvements to the programming FAQ (#127261) · python/cpython@23a658b · GitHub
[go: up one dir, main page]

Skip to content
< 8000 header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark>

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 23a658b

Browse files
Minor improvements to the programming FAQ (#127261)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 2505573 commit 23a658b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Doc/faq/programming.rst

Lines changed: 7 additions & 7 deletions
  • 8000
Original file line numberDiff line numberDiff line change
@@ -986,8 +986,8 @@ There are various techniques.
986986
f()
987987

988988

989-
Is there an equivalent to Perl's chomp() for removing trailing newlines from strings?
990-
-------------------------------------------------------------------------------------
989+
Is there an equivalent to Perl's ``chomp()`` for removing trailing newlines from strings?
990+
-----------------------------------------------------------------------------------------
991991

992992
You can use ``S.rstrip("\r\n")`` to remove all occurrences of any line
993993
terminator from the end of the string ``S`` without removing other trailing
@@ -1005,8 +1005,8 @@ Since this is typically only desired when reading text one line at a time, using
10051005
``S.rstrip()`` this way works well.
10061006

10071007

1008-
Is there a scanf() or sscanf() equivalent?
1009-
------------------------------------------
1008+
Is there a ``scanf()`` or ``sscanf()`` equivalent?
1009+
--------------------------------------------------
10101010

10111011
Not as such.
10121012

@@ -1020,8 +1020,8 @@ For more complicated input parsing, regular expressions are more powerful
10201020
than C's ``sscanf`` and better suited for the task.
10211021

10221022

1023-
What does 'UnicodeDecodeError' or 'UnicodeEncodeError' error mean?
1024-
-------------------------------------------------------------------
1023+
What does ``UnicodeDecodeError`` or ``UnicodeEncodeError`` error mean?
1024+
----------------------------------------------------------------------
10251025

10261026
See the :ref:`unicode-howto`.
10271027

@@ -1036,7 +1036,7 @@ A raw string ending with an odd number of backslashes will escape the string's q
10361036
>>> r'C:\this\will\not\work\'
10371037
File "<stdin>", line 1
10381038
r'C:\this\will\not\work\'
1039-
^
1039+
^
10401040
SyntaxError: unterminated string literal (detected at line 1)
10411041

10421042
There are several workarounds for this. One is to use regular strings and double

0 commit comments

Comments
 (0)
0