summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorAndre Delfino <adelfino@gmail.com>2021-04-27 04:15:31 (GMT)
committerGitHub <noreply@github.com>2021-04-27 04:15:31 (GMT)
commit743e2bae10d2010fd1e29b772c9da64efc7c9c47 (patch)
tree7ea344cecfd7fdad33a8fde3599451ada9a1684e /Doc
parent9dfefbe3e2dc548ad306870b56cc0cb475aa20a2 (diff)
downloadcpython-743e2bae10d2010fd1e29b772c9da64efc7c9c47.zip
cpython-743e2bae10d2010fd1e29b772c9da64efc7c9c47.tar.gz
cpython-743e2bae10d2010fd1e29b772c9da64efc7c9c47.tar.bz2
[doc] Remove duplicated operator.itemgetter example (GH-24178)
* Remove duplicated itemgetter example * Add spaces
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/operator.rst7
1 files changed, 2 insertions, 5 deletions
diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst
index 36c5355..0cdba68 100644
--- a/Doc/library/operator.rst
+++ b/Doc/library/operator.rst
@@ -319,15 +319,12 @@ expect a function argument.
method. Dictionaries accept any hashable value. Lists, tuples, and
strings accept an index or a slice:
- >>> itemgetter('name')({'name': 'tu', 'age': 18})
- 'tu'
>>> itemgetter(1)('ABCDEFG')
'B'
- >>> itemgetter(1,3,5)('ABCDEFG')
+ >>> itemgetter(1, 3, 5)('ABCDEFG')
('B', 'D', 'F')
- >>> itemgetter(slice(2,None))('ABCDEFG')
+ >>> itemgetter(slice(2, None))('ABCDEFG')
'CDEFG'
-
>>> soldier = dict(rank='captain', name='dotterbart')
>>> itemgetter('rank')(soldier)
'captain'