[Python-checkins] Doc: Do not suggest `s[::-1]` for reversed order (GH-22457)

miss-islington webhook-mailer at python.org
Wed Oct 21 04:47:59 EDT 2020


https://github.com/python/cpython/commit/03bfb07937cbb91f3dcdbc5f6f644b481e331a49
commit: 03bfb07937cbb91f3dcdbc5f6f644b481e331a49
branch: 3.9
author: Miss Skeleton (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2020-10-21T01:47:54-07:00
summary:

Doc: Do not suggest `s[::-1]` for reversed order (GH-22457)

(cherry picked from commit fb2e94692e3a8eb66915575f4a122d56fe8999a0)

Co-authored-by: Andre Delfino <adelfino at gmail.com>

files:
M Doc/faq/programming.rst
M Doc/tools/susp-ignored.csv

diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
index 1d1155953e12f..8df62c5604597 100644
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -1116,7 +1116,7 @@ trailing newline from a string.
 How do I iterate over a sequence in reverse order?
 --------------------------------------------------
 
-Use the :func:`reversed` built-in function, which is new in Python 2.4::
+Use the :func:`reversed` built-in function::
 
    for x in reversed(sequence):
        ...  # do something with x ...
@@ -1124,11 +1124,6 @@ Use the :func:`reversed` built-in function, which is new in Python 2.4::
 This won't touch your original sequence, but build a new copy with reversed
 order to iterate over.
 
-With Python 2.3, you can use an extended slice syntax::
-
-   for x in sequence[::-1]:
-       ...  # do something with x ...
-
 
 How do you remove duplicates from a list?
 -----------------------------------------
diff --git a/Doc/tools/susp-ignored.csv b/Doc/tools/susp-ignored.csv
index 7be8d0abd69a5..e03c68fa98a0b 100644
--- a/Doc/tools/susp-ignored.csv
+++ b/Doc/tools/susp-ignored.csv
@@ -12,7 +12,6 @@ extending/extending,,:myfunction,"PyArg_ParseTuple(args, ""D:myfunction"", &c);"
 extending/extending,,:set,"if (PyArg_ParseTuple(args, ""O:set_callback"", &temp)) {"
 extending/newtypes,,:call,"if (!PyArg_ParseTuple(args, ""sss:call"", &arg1, &arg2, &arg3)) {"
 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("
-faq/programming,,::,for x in sequence[::-1]:
 faq/programming,,:reduce,"print((lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,"
 faq/programming,,:reduce,"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,"
 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"



More information about the Python-checkins mailing list