From: Benjamin Peterson Date: Sat, 21 Aug 2010 20:01:28 +0000 (+0000) Subject: indent properly X-Git-Tag: v3.2a2~182 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ffec810d886bb1e1f71e4d132b494143a091e663;p=thirdparty%2FPython%2Fcpython.git indent properly --- diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index e24c69f79dba..54edf3186e0d 100644 --- a/Doc/library/operator.rst +++ b/Doc/library/operator.rst @@ -344,15 +344,15 @@ expect a function argument. operand's :meth:`__getitem__` method. If multiple items are specified, returns a tuple of lookup values. Equivalent to:: - def itemgetter(*items): - if len(items) == 1: - item = items[0] - def g(obj): - return obj[item] - else: - def g(obj): - return tuple(obj[item] for item in items) - return g + def itemgetter(*items): + if len(items) == 1: + item = items[0] + def g(obj): + return obj[item] + else: + def g(obj): + return tuple(obj[item] for item in items) + return g The items can be any type accepted by the operand's :meth:`__getitem__` method. Dictionaries accept any hashable value. Lists, tuples, and