mirror of https://github.com/python/cpython
Add module specification: itemgetter -> operator.itemgetter (GH-12823)
This commit is contained in:
parent
9013ccf6d8
commit
b4c7f39bbf
|
@ -827,7 +827,7 @@ which incur interpreter overhead.
|
|||
"List unique elements, preserving order. Remember only the element just seen."
|
||||
# unique_justseen('AAAABBBCCDAABBB') --> A B C D A B
|
||||
# unique_justseen('ABBCcAD', str.lower) --> A B C A D
|
||||
return map(next, map(itemgetter(1), groupby(iterable, key)))
|
||||
return map(next, map(operator.itemgetter(1), groupby(iterable, key)))
|
||||
|
||||
def iter_except(func, exception, first=None):
|
||||
""" Call a function repeatedly until an exception is raised.
|
||||
|
|
Loading…
Reference in New Issue