diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index e4d6d05a23a..250cbb6b7c0 100644 --- a/Doc/library/operator.rst +++ b/Doc/library/operator.rst @@ -315,6 +315,8 @@ 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')