Skip to content

Commit 62eb403

Browse files
Doc: Do not suggest s[::-1] for reversed order (GH-22457)
(cherry picked from commit fb2e946) Co-authored-by: Andre Delfino <[email protected]>
1 parent 490f30d commit 62eb403

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

Doc/faq/programming.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,19 +1121,14 @@ trailing newline from a string.
11211121
How do I iterate over a sequence in reverse order?
11221122
--------------------------------------------------
11231123

1124-
Use the :func:`reversed` built-in function, which is new in Python 2.4::
1124+
Use the :func:`reversed` built-in function::
11251125

11261126
for x in reversed(sequence):
11271127
... # do something with x ...
11281128

11291129
This won't touch your original sequence, but build a new copy with reversed
11301130
order to iterate over.
11311131

1132-
With Python 2.3, you can use an extended slice syntax::
1133-
1134-
for x in sequence[::-1]:
1135-
... # do something with x ...
1136-
11371132

11381133
How do you remove duplicates from a list?
11391134
-----------------------------------------

Doc/tools/susp-ignored.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ extending/extending,,:myfunction,"PyArg_ParseTuple(args, ""D:myfunction"", &c);"
1212
extending/extending,,:set,"if (PyArg_ParseTuple(args, ""O:set_callback"", &temp)) {"
1313
extending/newtypes,,:call,"if (!PyArg_ParseTuple(args, ""sss:call"", &arg1, &arg2, &arg3)) {"
1414
faq/programming,,:chr,">=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr("
15-
faq/programming,,::,for x in sequence[::-1]:
1615
faq/programming,,:reduce,"print((lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,"
1716
faq/programming,,:reduce,"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,"
1817
faq/windows,,:d48eceb,"Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32"

0 commit comments

Comments
 (0)