Skip to content

Commit 8903b51

Browse files
committed
-
1 parent 98940a3 commit 8903b51

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source_py3/python_toolbox/cute_iter_tools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,9 @@ def is_sorted(iterable, *, rising=True, strict=False, key=None):
476476
(False, True): operator.gt,
477477
(True, False): operator.le,
478478
(True, True): operator.lt,}[(rising, strict)]
479-
for first_item, second_item in iterate_overlapping_subsequences(iterable):
480-
if not comparer(key(first_item), key(second_item)):
479+
for key_of_first_item, key_of_second_item in \
480+
iterate_overlapping_subsequences(map(key, iterable)):
481+
if not comparer(key_of_first_item, key_of_second_item):
481482
return False
482483
else:
483484
return True

0 commit comments

Comments
 (0)