We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c816c1c commit 4a3d73dCopy full SHA for 4a3d73d
Doc/library/operator.rst
@@ -315,15 +315,12 @@ expect a function argument.
315
method. Dictionaries accept any hashable value. Lists, tuples, and
316
strings accept an index or a slice:
317
318
- >>> itemgetter('name')({'name': 'tu', 'age': 18})
319
- 'tu'
320
>>> itemgetter(1)('ABCDEFG')
321
'B'
322
- >>> itemgetter(1,3,5)('ABCDEFG')
+ >>> itemgetter(1, 3, 5)('ABCDEFG')
323
('B', 'D', 'F')
324
- >>> itemgetter(slice(2,None))('ABCDEFG')
+ >>> itemgetter(slice(2, None))('ABCDEFG')
325
'CDEFG'
326
-
327
>>> soldier = dict(rank='captain', name='dotterbart')
328
>>> itemgetter('rank')(soldier)
329
'captain'
0 commit comments