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

(cherry picked from commit fb2e94692e)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
This commit is contained in:
Miss Skeleton (bot) 2020-10-21 01:47:54 -07:00 committed by GitHub
parent f72101bb62
commit 03bfb07937
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 7 deletions

View file

@ -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?
-----------------------------------------